On Tuesday 10 December 2002 13:05, Richard Allen wrote:
> Hello all.  I've been trying to get accented characters to work propperly
> in wine.
> For those who dont know, accented characters are beasts like "áéýúíó"
> We obtain them by pressing the dead key (mute_acute in my case) and then
> the key we want accented.
>
> I'm using CVS as of yesterday.
> [ra@xo winecvs]$ cat wine/VERSION
> Wine version 20021125
>
> As far as I can tell, dlls/x11drv/keyboard.c seems to be where my
> problem is.
>
> [ra@xo ra]$ wine /home/ra/.wine/c_drive/Program\ Files/mIRC/mirc.exe
> fixme:keyboard:X11DRV_KEYBOARD_DetectLayout Your keyboard layout was not
> found! Using closest match instead (Icelandic keyboard layout) for scancode
> mapping. Please define your layout in windows/x11drv/keyboard.c and submit
> them to us for inclusion into future Wine releases.
> See the Wine User Guide, chapter "Keyboard" for more information.
>
> Now, keyboard.c does have a definition for the Icelandic keyboard, but as
> far as I can tell it's only used to recognize what keymap is in action, and
> not to define it ?.   I've experimented with it, things like changing the
> "2" key to a "b" but it did not change the keyboard layout.
>
> The warning above is just because the definition in wine for the IS keymap
> doesnt match the one thats shipping with XFRee86 completely ?
>
> Anyway. my battle for the accented characters continues.  The keyboard
> handling in wine is unlike anything I've ever seen before.
> Can anyone give me a quick runthru on how keyboard handling really works
> in wine, and prehaps help fix this ?
>
> Also, how are accented characters (dead keys) working in other languages ?
> Is this a problem limited to Icelandic or to accented characters in
> general ?

AFAIK this is a general problem. The attached patch should solve it. Tough it 
is not the proper fix (at least there is a better fix that will be merged in 
wine in the future). For more info see my reply to email 'Turkish keyboard 
Support' from yesterday.

Regards
Zsolt
Index: dlls/x11drv/keyboard.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/keyboard.c,v
retrieving revision 1.11
diff -u -p -r1.11 keyboard.c
--- dlls/x11drv/keyboard.c	10 Oct 2002 23:30:13 -0000	1.11
+++ dlls/x11drv/keyboard.c	14 Oct 2002 21:43:34 -0000
@@ -1773,17 +1773,61 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT 
 	    }
 	else
 	    {
-	    char	*ksname;
-
-	    ksname = TSXKeysymToString(keysym);
-	    if (!ksname)
-		ksname = "No Name";
-	    if ((keysym >> 8) != 0xff)
+		if ((keysym >> 8) != 0xff)
 		{
-		ERR("Please report: no char for keysym %04lX (%s) :\n",
-                    keysym, ksname);
-		ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n",
-                    virtKey, scanCode, e.keycode, e.state);
+		    unsigned char byte3 = (unsigned char )(keysym >> 8);
+		    UINT cp = 0;
+		    switch (byte3) {
+			case 0: // Latin 1
+			case 1: // Latin 2
+			case 2: // Latin 3
+			case 3: // Latin 4
+			case 5: // arabic
+			    cp = 28591 + byte3; break;
+			case 4: // kana
+			    break;
+			case 6: // Cyrillic
+			    cp = 28595; break;
+			case 7: //greek
+			    cp = 28597; break;
+			case 8: // Technical
+			case 9: // Special
+			case 10: // Publishing
+			case 11: // APL
+			    break;
+			case 12: // Hebrew
+			    cp = 28598; break;
+			case 13: // Thai
+			    cp = 874; break; // not ISO
+			case 14: // Korean, no mapping
+			    cp = 949; break; // not ISO
+			case 18: // Latin 8
+			    cp = 28604; break;
+			case 19: // Latin 9
+			    cp = 28605; break;
+			case 20: // Armenian
+			case 21: // Gregorian
+			case 22: // Azeri
+			case 30: // Vietnamese
+			case 32: // Currency
+			    break;
+		    }
+		    if (cp)
+		    {
+			BYTE key_char = keysym & 0xff;
+			ret = MultiByteToWideChar(cp, 0, &key_char, 1, bufW, bufW_size);
+		    }
+		    else
+		    {
+			char        *ksname;
+			ksname = TSXKeysymToString(keysym);
+			if (!ksname)
+			    ksname = "No Name";
+			ERR("Please report: no char for keysym %04lX (%s) :\n",
+				keysym, ksname);
+			ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n",
+				virtKey, scanCode, e.keycode, e.state);
+		    }
 		}
 	    }
 	}

Reply via email to