From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37134 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmSiq-0001oB-NV for qemu-devel@nongnu.org; Fri, 20 Aug 2010 10:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmSip-0003sR-AU for qemu-devel@nongnu.org; Fri, 20 Aug 2010 10:37:32 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:64783) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmSip-0003sH-70 for qemu-devel@nongnu.org; Fri, 20 Aug 2010 10:37:31 -0400 Received: by gxk5 with SMTP id 5so1365233gxk.4 for ; Fri, 20 Aug 2010 07:37:30 -0700 (PDT) Message-ID: <4C6E9324.1050002@codemonkey.ws> Date: Fri, 20 Aug 2010 09:37:24 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 7/9] spice: add mouse References: <1282221625-29501-1-git-send-email-kraxel@redhat.com> <1282221625-29501-8-git-send-email-kraxel@redhat.com> <4C6D3EEA.4020201@codemonkey.ws> <4C6E7849.1010906@redhat.com> <4C6E80E8.6040202@codemonkey.ws> <4C6E8B49.3040601@redhat.com> In-Reply-To: <4C6E8B49.3040601@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On 08/20/2010 09:03 AM, Gerd Hoffmann wrote: > Hi, > >>> Again this is libspice interface (and I think also wire protocol), so >>> I can't change it. I can convert dz into some button_mask bits before >>> calling kbd_mouse_event, but looking at the vnc code it seems qemu >>> expects the mouse wheel events being passed via dz not button_state. >> >> That's unfortunate but understood. Is Spice considered a stable API/wire >> protocol at this point? > > Yes. There are version numbers though, so we can add new messages and > use them in case both server and client are new enough. Unfortunaly > this makes the keyboard f*ckup only slightly less messy as we'll have > to support both old+new way for compatibility reasons. Oh well. One of the things to consider is that we only emulate a 2-axis 5 button mouse. Buttons one through three are bits in button_state and buttons 4/5 are represented through dz. My mouse IRL is actually a 9 button mouse. We encode buttons 4/5 as a -1, 0, 1 in dz which corresponds to 10, 00, and 11. We cannot represent 11 with dz which corresponds to having buttons 4 and 5 pressed simultaneously. Most mice have a scroll wheel for 4/5 but there's no strict requirement that that's the case. So in terms of building a long term stable wire protocol, you'd be much better off using button_mask to encode buttons 4/5 because it's just a matter of time before we drop the dz hack in qemu. Regards, Anthony Liguori > cheers, > Gerd >