http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #7 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-10 21:45:29 --- (In reply to comment #5)
(In reply to comment #4)
Neither Mode_switch nor ISO_Level3_Shift are guaranteed to be generated by pressing Right Alt, in fact, it's all keyboard mapping dependent.
The same can be said for XK_Alt_R; relying on keysyms to detect the right alt key might not be the best way.
I'd say that relying on keysyms is the only way to handle keyboard events properly.
Besides, Mode_switch is currently being treated by Wine as the right alt key, at least so far as the scancode is concerned; see the entry for 0xff7e in the nonchar_key_scan array, located in dlls/winex11.drv/keyboard.c .
That's apparently a bug in nonchar_key_scan array, it's supposed to match nonchar_key_vkey, and besides that line is under the /* keypad keys */ comment, which clearly marks where that keys belong to.
At least under Ubuntu 8.04, XK_Alt_R is not generated from the right alt key in any of the keyboard layouts I've tested (US, US International, Brazil, and half a dozen other random layouts); the configuration can be changed to generate it from the right windows key, but without messing with the shell I couldn't make it be generated from the right alt key proper. Using it as the only way wine detects the right alt key leaves this key broken in wine at least under the current Ubuntu version (unless the user change it himself with the xkb tools), and possibly under other distros also (almost certainly Debian, maybe others). From my tests, if the user doesn't mess with xkb, Ubuntu allways generates ISO_Level3_Shift when pressing the right alt key. Of course, messing with the xkb options can leave he with another keysym for the right alt, for example Multi_key (0xff20).
My Ubuntu 7.04 generates XK_Alt_R when I press right Alt key, do you have some custom xmodmap config, or a keyboard layout manager?