patch for xf86-input-keyboard

Timo Aaltonen tjaalton at cc.hut.fi
Tue Jun 12 02:33:02 PDT 2007


On Fri, 4 May 2007, Timo Aaltonen wrote:

>
> 	Hi
>
>  There's a patch that has been in Ubuntu for a year now, and I wonder if the 
> problem could be fixed otherwise so it could get upstream. Patch is attached, 
> here is the reasoning:
>
>  * Let keycodes 209 and 210 pass through; they're Hangul and Hangul_Hanja
>    keys, needed for Korean keyboards to function correctly.  This fix is
>    mostly a band-aid since XKB doesn't have a way to specify that "this
>    key doesn't give you keydown and keyup events"

No opinions?

Here's the patch again:

+  * Let keycodes 209 and 210 pass through; they're Hangul and Hangul_Hanja
+    keys, needed for Korean keyboards to function correctly.  This fix is
+    mostly a band-aid since XKB doesn't have a way to specify that "this
+    key doesn't give you keydown and keyup events"
+
+ -- Tollef Fog Heen <tfheen at ubuntu.com>  Thu, 16 Mar 2006 14:32:31 +0100
+
+Index: xserver-xorg-input-keyboard-1.1.0-4ubuntu1/src/kbd.c
+===================================================================
+--- xserver-xorg-input-keyboard-1.1.0-4ubuntu1.orig/src/kbd.c	2007-02-28 12:45:01.000000000 +0200
++++ xserver-xorg-input-keyboard-1.1.0-4ubuntu1/src/kbd.c	2007-02-28 12:45:13.000000000 +0200
+@@ -774,7 +774,7 @@
+   /*
+    * check for an autorepeat-event
+    */
+-  if (down && KeyPressed(keycode)) {
++  if (down && KeyPressed(keycode) && keycode < 146) {
+       int num = keycode >> 3;
+       int bit = 1 << (keycode & 7);
+
+@@ -787,11 +787,29 @@
+    if (UsePrefix) {
+       xf86PostKeyboardEvent(device,
+               keyc->modifierKeyMap[keyc->maxKeysPerModifier*7], TRUE);
+-      xf86PostKeyboardEvent(device, keycode, down);
++      /* 209 and 210 are Hangul and Hangul_Hanja, used on Korean
++         keyboards. They only generate keyup events (!) */
++      if (keycode < 146 || keycode == 209 || keycode == 210) {
++	      xf86PostKeyboardEvent(device, keycode, down);
++      } else if (down) {
++	      /* If it's a key down event, send a down and up. Otherwise
++		 drop it */
++	      xf86PostKeyboardEvent(device, keycode, TRUE);
++	      xf86PostKeyboardEvent(device, keycode, FALSE);
++      }
+       xf86PostKeyboardEvent(device,
+               keyc->modifierKeyMap[keyc->maxKeysPerModifier*7], FALSE);
+    } else {
+-      xf86PostKeyboardEvent(device, keycode, down);
++     /* 209 and 210 are Hangul and Hangul_Hanja, used on Korean
++        keyboards. They only generate keyup events (!) */
++	   if (keycode < 146 || keycode == 209 || keycode == 210) {
++		   xf86PostKeyboardEvent(device, keycode, down);
++	   } else if (down) {
++		   /* If it's a key down event, send a down and up. Otherwise
++		      drop it */
++		   xf86PostKeyboardEvent(device, keycode, TRUE);
++		   xf86PostKeyboardEvent(device, keycode, FALSE);
++	   }
+    }
+ }
+


t



More information about the xorg mailing list