From: "Daniel P. Berrange" Subject: [PATCH] Support all 8 mouse buttons in PVFB Date: Wed, 7 Feb 2007 03:29:44 +0000 Message-ID: <20070207032944.GB29320@redhat.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TRYliJ5NKNqkz5bu" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The VNC protocol allows upto 8 mouse buttons. The Dom0 -> DomU paravirt FB protocol supports upto 8 mouse buttons. The VNC server in Dom0 simply drops all mouse buttons > 3. Similarly when declaring capabilities to the kernel, the xenkdb.c driver in DomU simply says it only supports 3 buttons, but evdev is perfectly capable of exposing all 8 buttons. These two limitations both mean that the mouse scroll wheels don't work in paravirt DomU. The fixes for both these issues are trivial - just add in the relevant evdev constants for buttons 4 -> 8. Now I don't actually have an 8 button mouse handy to explicitly test upto 8, but I've no reason to believe that buttons 4-8 have any non-linear ordering - only right & middle buttons seem to be wierd in this regard. I've tested with a 5 button mouse & confirmed the scrollwheel is operating correctly. ie, if you run 'xev' in Dom0 and 'xev' in DomU you see the same X mouse button events in both cases, and the scroll up & down functions work correctly. I'm attaching two patches. One fixes the fbfront/xenkbd.c driver (it applies against xen-devel - should be trivial to fixup against Gerd's latest patch). The other patch fixes the VNC server - it also removes a c99-ism since we don't compile with c99 enabled. Signed-off-by: Daniel P. Berrange Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-kernel-mouse-buttons.patch" diff -r e212203d7d34 linux-2.6-xen-sparse/drivers/xen/fbfront/xenkbd.c --- a/linux-2.6-xen-sparse/drivers/xen/fbfront/xenkbd.c Tue Feb 06 23:01:35 2007 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/fbfront/xenkbd.c Tue Feb 06 22:05:07 2007 -0500 @@ -107,7 +107,9 @@ int __devinit xenkbd_probe(struct xenbus input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS); input_dev->keybit[LONG(BTN_MOUSE)] - = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT) | + BIT(BTN_SIDE) | BIT(BTN_EXTRA) | BIT(BTN_FORWARD) | + BIT(BTN_BACK) | BIT(BTN_TASK); /* TODO additional buttons */ input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-vnc-mouse-buttons.patch" diff -r e212203d7d34 tools/xenfb/vncfb.c --- a/tools/xenfb/vncfb.c Tue Feb 06 23:01:35 2007 +0000 +++ b/tools/xenfb/vncfb.c Fri Feb 02 20:42:07 2007 -0500 @@ -57,7 +57,8 @@ static void *kbd_layout; static void *kbd_layout; static int btnmap[] = { - BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_FORWARD, BTN_BACK + BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_SIDE, + BTN_EXTRA, BTN_FORWARD, BTN_BACK, BTN_TASK }; static void on_kbd_event(rfbBool down, rfbKeySym keycode, rfbClientPtr cl) @@ -73,11 +74,12 @@ static void on_kbd_event(rfbBool down, r */ rfbScreenInfoPtr server = cl->screen; struct xenfb *xenfb = server->screenData; + int scancode; if( keycode >= 'A' && keycode <= 'Z' ) keycode += 'a' - 'A'; - int scancode = keycode_table[keysym2scancode(kbd_layout, keycode)]; + scancode = keycode_table[keysym2scancode(kbd_layout, keycode)]; if (scancode == 0) return; if (xenfb_send_key(xenfb, down, scancode) < 0) --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --TRYliJ5NKNqkz5bu--