http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #5 from Fábio Capela fabio.capela@yahoo.com 2008-09-10 11:45:09 --- (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. 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 .
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).