On Sat, Jun 07, 2003 at 07:51:04PM +0700, Ivan Pascal wrote:
>  Hi,
>
>> The linux-ppc kernel has an option (CONFIG_MAC_ADBKEYCODES) to use the "old" 
>> ADB-style keycodes. I imagine setting this option to "no" uses the conversion 
>> you're talking about. For the record, the scancodes I see (from showkey -s) 
>> are as follows:
>> 
>> KeyPad Equals :  0x5c 0xdc
>> Left Arrow :      0xe0 0x4b 0xe0 0xcb
>
>Wow!  It is exactly what I told about.
>I didn't say what Xserver's driver does with one-byte codes.
>Actually it does:
>- converts 0xe0 <xx> sequences to some one byte code
>- and then adds 8 to every code, including one-byte scan-codes and codes
>(one-byte too) got from the sequences covertion.
>
>  Therefore 0x5c code after that becomes 5c+8 = 0x64 hex or 100 dec.
>And the Left arrow sequence at the first step is converted to 0x5c too and
>after adding 8 becomes 100 (dec).

The X server's driver uses codes (like 0x5c) that it doesn't expect to
ever see as input to encode the 0xe0 0xXX two-byte codes.

We have a KEY_KP_Equal value defined in common/atKeynames.h: 0x76 (+8 = 126).
This conflicts with the value used for <META> in xkbcomp/keycodes/xfree86.

My suggestion would be the following patch for the XFree86 DDX, and
assign <META> to a different value, assign <KPEQ> to 126 in
xkbcomp/keycodes/xfree86, (and make <KPEQ> to a keysym in the appropriate
places).

Index: xc/programs/Xserver/hw/xfree86/common/xf86Events.c
===================================================================
RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v
retrieving revision 3.149
diff -u -r3.149 xf86Events.c
--- xc/programs/Xserver/hw/xfree86/common/xf86Events.c  3 Apr 2003 16:20:23 -0000      
 3.149
+++ xc/programs/Xserver/hw/xfree86/common/xf86Events.c  9 Jun 2003 19:23:10 -0000
@@ -456,8 +456,14 @@
     case 0x72:        scanCode = KEY_AltLang;  break;  /* AltLang(right) */
     case 0x73:        scanCode = KEY_RCtrl;    break;  /* not needed */
     }
+  } else
+#else /* i386 && SVR4 */
+  {
+    switch (scanCode) {
+    case 0x5C:        scanCode = KEY_KP_Equal; break;  /* Keypad Equal */
+    }
   }
-#endif  /* i386 && SVR4 */
+#endif  /* !(i386 && SVR4) */
 
 #ifdef __linux__
   if (xf86Info.kbdCustomKeycodes) {
Index: xc/programs/xkbcomp/keycodes/xfree86
===================================================================
RCS file: /home/x-cvs/xc/programs/xkbcomp/keycodes/xfree86,v
retrieving revision 3.20
diff -u -r3.20 xfree86
--- xc/programs/xkbcomp/keycodes/xfree86        15 May 2003 13:31:58 -0000      3.20
+++ xc/programs/xkbcomp/keycodes/xfree86        9 Jun 2003 19:26:13 -0000
@@ -138,6 +138,7 @@
 
     <KP0>  =  90;
     <KPDL> =  91;
+    <KPEQ> = 126;
 
     <FK13> =  118;
     <FK14> =  119;
@@ -298,7 +299,7 @@
     <MDSW> =    93; // <U5D>
     <LVL3> =   124; // <U7C>
     <ALT>  =   125; // <U7D>
-    <META> =   126; // <U7E>
+    <META> =   156; // <I1C>
     <SUPR> =   127; // <U7F>
     <HYPR> =   128; // <U80>
 
Index: xc/programs/xkbcomp/symbols/us
===================================================================
RCS file: /home/x-cvs/xc/programs/xkbcomp/symbols/us,v
retrieving revision 3.12
diff -u -r3.12 us
--- xc/programs/xkbcomp/symbols/us      20 Nov 2002 04:49:03 -0000      3.12
+++ xc/programs/xkbcomp/symbols/us      9 Jun 2003 19:29:21 -0000
@@ -160,6 +160,7 @@
     key  <KP2> {       [  KP_Down,     KP_2    ]       };
     key  <KP3> {       [  KP_Next,     KP_3    ]       };
     key <KPEN> {       [       KP_Enter        ]       };
+    key <KPEQ> {       [       KP_Equal        ]       };
 
     key  <KP0> {       [  KP_Insert,   KP_0    ]       };
     key <KPDL> {  [  KP_Delete,        KP_Decimal ]    };
Index: xc/programs/xkbcomp/symbols/pc/pc
===================================================================
RCS file: /home/x-cvs/xc/programs/xkbcomp/symbols/pc/pc,v
retrieving revision 1.8
diff -u -r1.8 pc
--- xc/programs/xkbcomp/symbols/pc/pc   15 May 2003 13:32:00 -0000      1.8
+++ xc/programs/xkbcomp/symbols/pc/pc   9 Jun 2003 19:28:53 -0000
@@ -165,6 +165,7 @@
     key  <KP2> {       [  KP_Down,     KP_2    ]       };
     key  <KP3> {       [  KP_Next,     KP_3    ]       };
     key <KPEN> {       [       KP_Enter        ]       };
+    key <KPEQ> {       [       KP_Equal        ]       };
 
     key  <KP0> {       [  KP_Insert,   KP_0    ]       };
     key <KPDL> {       [  KP_Delete,   KP_Decimal ]    };


David
-- 
David Dawes
Founder/committer/developer                     The XFree86 Project
www.XFree86.org/~dawes
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to