On Mon, Jun 09, 2003 at 03:31:01PM -0400, David Dawes wrote:
>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) {

The following might be a better patch for xf86Events.c, because these
conversions should only happen with there is no scan prefix.

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:52:16 -0000
@@ -440,25 +440,6 @@
     goto special;
 #endif /* __sparc__ */
 
-#if defined (i386) && defined (SVR4)
-    /* 
-     * PANIX returns DICOP standards based keycodes in using 106jp 
-     * keyboard. We need to remap some keys. 
-     */
-  if(xf86Info.panix106 == TRUE){
-    switch (scanCode) {
-    case 0x56:        scanCode = KEY_BSlash2;  break;  /* Backslash */
-    case 0x5A:        scanCode = KEY_NFER;     break;  /* No Kanji Transfer*/
-    case 0x5B:        scanCode = KEY_XFER;     break;  /* Kanji Tranfer */
-    case 0x5C:        scanCode = KEY_Yen;      break;  /* Yen curs pgup */
-    case 0x6B:        scanCode = KEY_Left;     break;  /* Cur Left */
-    case 0x6F:        scanCode = KEY_PgUp;     break;  /* Cur PageUp */
-    case 0x72:        scanCode = KEY_AltLang;  break;  /* AltLang(right) */
-    case 0x73:        scanCode = KEY_RCtrl;    break;  /* not needed */
-    }
-  }
-#endif  /* i386 && SVR4 */
-
 #ifdef __linux__
   if (xf86Info.kbdCustomKeycodes) {
     specialkey = SpecialServerMap[scanCode];
@@ -489,6 +470,30 @@
       break;
 #endif
     }
+#if defined (i386) && defined (SVR4)
+    /* 
+     * PANIX returns DICOP standards based keycodes in using 106jp 
+     * keyboard. We need to remap some keys. 
+     */
+    if(xf86Info.panix106 == TRUE){
+      switch (scanCode) {
+      case 0x56:        scanCode = KEY_BSlash2;        break;  /* Backslash */
+      case 0x5A:        scanCode = KEY_NFER;   break;  /* No Kanji Transfer*/
+      case 0x5B:        scanCode = KEY_XFER;   break;  /* Kanji Tranfer */
+      case 0x5C:        scanCode = KEY_Yen;    break;  /* Yen curs pgup */
+      case 0x6B:        scanCode = KEY_Left;   break;  /* Cur Left */
+      case 0x6F:        scanCode = KEY_PgUp;   break;  /* Cur PageUp */
+      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) */
   }
 
   else if (


I'll commit this (and the rest of the patch).  Could someone test it
and let us know if it works correctly?

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