[Spice-devel] [PATCH] xspice_keyboard_proc: fix arrow keys

Alon Levy alevy at redhat.com
Fri Feb 3 08:18:48 PST 2012


Not sure yet why the regression with the arrow keys not producing the
right keysym, but it appears that the keycode is correct for up (as an
example), 111, but the keysym being produced was 0xff6c and not the
correct 0xff52. This boiled down to the rules of the default rmlvo being
"base" instead of "evdev". Providing an rmlvo parameter to
InitKeyboardDeviceStruct allows to override that. The chosen
 rules = "evdev"
 model = "pc105"
 layout = "us"
Is the default used by Xephyr from
xorg-x11-server-Xephyr-1.11.99.901-3.20120124.fc17.x86_64
---
 src/spiceqxl_inputs.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/spiceqxl_inputs.c b/src/spiceqxl_inputs.c
index cdbc20c..a57812a 100644
--- a/src/spiceqxl_inputs.c
+++ b/src/spiceqxl_inputs.c
@@ -149,12 +149,19 @@ static void xspice_keyboard_control(DeviceIntPtr device, KeybdCtrl *ctrl)
 static int xspice_keyboard_proc(DeviceIntPtr pDevice, int onoff)
 {
     DevicePtr pDev = (DevicePtr)pDevice;
+    XkbRMLVOSet rmlvo = {
+        .rules = "evdev",
+        .model = "pc105",
+        .layout = "us",
+        .variant = "",
+        .options = "",
+    };
 
     switch (onoff) {
         case DEVICE_INIT:
             InitKeyboardDeviceStruct(
-                pDevice, NULL, xspice_keyboard_bell, xspice_keyboard_control
-            );
+                pDevice, &rmlvo, xspice_keyboard_bell, xspice_keyboard_control
+            );// printf("XKeycodeToKeysym: %d -> %d\n", XKeycodeToKeysym());
             break;
         case DEVICE_ON:
             pDev->on = TRUE;
-- 
1.7.9



More information about the Spice-devel mailing list