Hi,

I'm trying to resolve a problem in Wine when using a non-us keyboard. Maybe
some keyboard specialist could help me. Here's the problem:

Most of the non-us keyboard are configured to display different characters
if the right Alt key(AltGr) is pressed.

Ex: With the French keyboard:
Key pressed   Result
3            --> '"'
Shift+3      --> '3'
AltGr+3      --> '#'

With Wine AltGr+3 will return the same value as if you haven't pressed
AltGr. I've looked at the code and everything seems to be there to handle
this case. So I've digged down a little more and I found:

1. At initialization time in X11DRV_KEYBOARD_Init(), Wine is trying to find
what is the modifier index for AltGr by calling XGetKeyboardMapping(). X
doesn't return AltGr as a modifier key. Why AltGr is not a modifier?

2. When handling XKeyEvent in function X11DRV_KEYBOARD_HandleEvent(), Wine
use function XLookupString() to find the string associated to the XKeyEvent.
So with the French keyboard I'm seeing:

When I'm pressing 3 --> XKeyEvent.state=0 XKeyEvent.keycode=0x0c -->
XlookupString return '"'

When I'm pressing AltGr+3 --> XKeyEvent.state=0 XKeyEvent.keycode=0x0c -->
XlookupString return '"'

When receiving the key event how can I differentiate between those two
events? Other Linux programs are dealing correctly with this situation, what
do you think they are doing differently?


Any help will be appreciated.

        Stephane Lussier
        Macadamian Technologies

Reply via email to