[Fwd: dead keys treatment using XmbLookupString]
Mauro Carvalho Chehab
mchehab at brturbo.com
Wed Jan 22 21:22:21 CST 2003
May be... Wine uses the idea to map keys into vkeys and then mapping
back to keys... If something goes wrong on this proccess, it could
produce strange results...
I can give you some new ideas, but as far as I never seen an
Icelandic keyboard, and of course don't have one to hack, you have to
try some hacking by yourself. I advice you to try (on this order):
1) May be your keyboard layout is not like a pure QWERTY
keyboard. On Brasilian keyboards, we have 49 "main" keys instead of 48.
So, I had to include this new key on the layout, generating the
'main_key_scan_abnt_qwerty' and the corresponding
'main_key_vkey_abnt_qwerty' tables, mapping the virtual key VK_OEM_8 to
the new key (c cedilla), after ASFGHJKL. You can see these on the
current Wine-CVS code. Please notice that the routines that maps keys to
vkeys espects to receive some specific VK_OEM_<n> codes for some keys,
like '\' (mapped as VK_OEM_7) on X11DRV_InitKeyboard. In fact, the only
available VK I found was VK_OEM_8.
2) on ToUnicode (with my patch applyied), what is the return of
ret=XmbLookupString? Please notice that, if the return is zero, it will
use the Xlib function 'MultiByteToWideChar' after running a code to map
the dead keys. Maybe the KEYBOARD_MapDeadKeysym is not treating your
dead_circumflex keycode correctly.
3) For brazilian keyboards I need only to change XLookupString
to XmbLookupString on KEYBOARD_ToUnicode function, in order to use XKB
treatment instead of Xlib, but there are some other points where that
function is used. Looking at a glance, I haven't found any reason to
change, but you can try to understand better the other calls.
I hope these comments can help you.
Richard Allen wrote:
>On Mon, Jan 13, 2003 at 12:07:10PM -0200, Mauro Carvalho Chehab wrote:
>I've been studying this quite a bit. With this patch, I've verifyed that
>some of the dead keys work, and some not. If I change the IS keymap
>so Im using dead_circumflex instead of dead_acute, then dead (accented)
>characters do work, but obviously not the right ones.
>This leads me to think that dead_acute characters are handled differently
>by wine than dead_circumflex characters are.
>Mauro, do you think I could be on to something here ?
>> As far as I know, wine keyboard.c uses XFree86 Keymap table to
>>compare your key definitions with their internal geometry. After that,
>>it maps every scan code to a virtual key. The virtual key is mapped
>>back to a scan code and to an unicode symbol by ToUnicode function.
>>During this proccess, it uses part of the original xfree mapping.
>> On the original ToUnicode function, it uses the function
>>XLookupString (a Xlib function) to map scan code->symbol. This function
>>is capable to work with latin characters, but it doesn't implement dead
>>keys translation on the current XFree86 implementations. In the past,
>>there was some Xlib hacking that changes this behavor (X11 R5
>>implementations). The new standard (X11 R6) creates the xkb extensions,
>>that provides new functions to treat locale imput data (XmbLookupString,
>>Xutf8LookupString and XwcLookupString). What it does is to use XFree86
>>locale settings to make this map.
>> The dead key treatment is defined on /usr/X11R6/lib/X11/locale.
>> The geometry of their keyboards, used by xkb, are on
>>/usr/X11R6/lib/X11/xkb (RedHat) or /etc/X11/xkb (Mandrake). The file
>>symbols/is, for example, contains some icelandic definitions.
>> From your answer, I would try to fix the XFree86 keyboard mapping on
>>symbols/is. I guess that this will solve both XFree and Wine (patched).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wine-devel