[patch] fix delete key on certain european keyboards

zhilla zhilla at spymac.com
Sat May 7 19:50:38 CDT 2005


reposting this here, looking for someone to fix a long standing wine bug.

text [edited] again:
well, this is just this:
http://bugs.winehq.org/show_bug.cgi?id=2400
and should apply to today's cvs.
i AM NOT the author!

it IS kinda urgent, since a lot of european keyboards are affected...
like hungarian, croatian, slovenian... all have "delete" key producing 
"<delete>,"
  instead of "<delete>". this patch is just a "works here" workaround, 
see url for more details.

i got response from some people, so i fixed comments, but what needs to 
be tuned, according to mr. Dmitry Timoshkov, is that it should use 
symbolic key(sym) names instead of hardcoded numbers. seems like a 
trivial task for a programmer (which i am not)
so, anybody up to it?

Changelog:

   * dlls/x11drv/keyboard.c

     Arpad Biro <biro_arpad at yahoo.com>
     (modified to current cvs by Marin Glibic <zhilla at spymac.com>)
     This fixes the problem is that when NumLock is active, both Del 
keys perform a "delete" action _and_ insert a comma (the decimal character).
-------------- next part --------------
--- dlls/x11drv/keyboard.c.orig	2005-05-05 23:33:23.000000000 +0200
+++ dlls/x11drv/keyboard.c	2005-05-05 23:38:44.000000000 +0200
@@ -1067,11 +1067,14 @@
     else
         XLookupString(e, NULL, 0, &keysym, NULL);
 
-    if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF)
-	&& (e->state & NumLockMask))
-        /* Only the Keypad keys 0-9 and . send different keysyms
-         * depending on the NumLock state */
-        return nonchar_key_vkey[keysym & 0xFF];
+    if (e->state & NumLockMask)     /* NumLock is active */
+    {    if (keysym == 0xFFAC)      /* Numeric Del pressed */
+         return keyc2vkey[0x3B];    /* comma */
+         if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF))
+         /* Only the Keypad keys 0-9 and . send different keysyms
+          * depending on the NumLock state */
+         return nonchar_key_vkey[keysym & 0xFF];
+    }
 
     TRACE_(key)("e->keycode = %x\n", e->keycode);
 



More information about the wine-devel mailing list