From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoTgn-0005ss-Ew for qemu-devel@nongnu.org; Mon, 17 Jun 2013 03:17:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoTgm-0005Mf-7g for qemu-devel@nongnu.org; Mon, 17 Jun 2013 03:17:21 -0400 Message-ID: <51BEB7DD.5040800@redhat.com> Date: Mon, 17 Jun 2013 09:16:45 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1371354005-26873-1-git-send-email-afaerber@suse.de> In-Reply-To: <1371354005-26873-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 0/8] monitor: Fix mouse_button and improve mouse_move commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: "Bernhard M. Wiedemann" , xen-devel , Stephan Kulow , Brad Hards , Peter Maydell , Stefano Stabellini , Mark Cave-Ayland , qemu-devel@nongnu.org, Luiz Capitulino , Blue Swirl , Alexander Graf , qemu-ppc , Paolo Bonzini , Ludwig Nussel Hi, > My solution is to obtain position and buttons state from where the VMState is: > I clean up the mouse event handler registration code a bit and extend it: > * one mandatory callback to obtain mouse button state and > * one optional callback to obtain absolute position state from backends. Hmm, querying state from the mouse drivers just to be able to pass it back in is a bit backwards. I'd rather go fix the event reporting interface. Instead of having *one* callback with *all* parameters I think we should have a callback per parameter, or maybe better a parameter type enum. i.e. instead of: mouse_event(x, y, z, button_state) We'll have mouse_event(type, value) Then we'll report moves this way: mouse_event(REL_X, 23); // or ABS_X for the tablet. mouse_event(REL_Y, 42); mouse_event(SYNC, 0); // <<= means "done, flush events to guest" And klicks this way: mouse_event(DOWN, BTN_LEFT); mouse_event(SYNC); mouse_event(UP, BTN_LEFT); mouse_event(SYNC); The linux input layer works in a simliar way. cheers, Gerd