wrong keyboard layout

Phil Krylov phil at newstar.rinet.ru
Tue Aug 12 10:52:49 CDT 2003


Hello,

Tuesday, August 12, 2003, 7:46:14 PM, I wrote:

PK>> Ah, it must be my fault - I used LANG instead of LC_ALL. Using
PK>> LC_ALL=ru_RU.UTF-8 and your latest patch (ignoring XK_ModeSwitch), my
PK>> keyboard started working perfectly.

PK> sorry, i made a mistake. ru_RU.KOI8-R works, while ru_RU.UTF-8 (which
PK> is my default setting) and en_US.UTF-8 don't.

But ru_RU.UTF-8 works with the following patch to keyboard.c (but it
won't work on XFree86 3.x):

--- keyboard.c  2003-08-12 19:23:29.000000000 +0400
+++ keyboard.c-mine     2003-08-12 19:39:21.000000000 +0400
@@ -1840,7 +1840,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT 
     else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
 
     if (xic)
-        ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL);
+        ret = Xutf8LookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL);
     else
         ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL);
     wine_tsx11_unlock();
@@ -1911,8 +1911,15 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT 
        /* perform translation to unicode */
        if(ret)
        {
-           TRACE_(key)("Translating char 0x%02x to unicode\n", *(BYTE *)lpChar);
-           ret = MultiByteToWideChar(CP_UNIXCP, 0, lpChar, ret, bufW, bufW_size);
+           if (xic)
+           {
+               TRACE_(key)("Translating string %.*s from UTF-8 to UCS-2\n",
+                           ret, lpChar);
+               ret = MultiByteToWideChar(CP_UTF8, 0, lpChar, ret, bufW, bufW_size);
+           } else {
+               TRACE_(key)("Translating char 0x%02x to unicode\n", *(BYTE *)lpChar);
+               ret = MultiByteToWideChar(CP_UNIXCP, 0, lpChar, ret, bufW, bufW_size);
+           }
        }
     }
 

PK>> Thanks!




-- 
Best regards,
 Phil                            mailto:phil at newstar.rinet.ru




More information about the wine-devel mailing list