http://bugs.winehq.org/show_bug.cgi?id=15203
Summary: World of Warcraft: Right alt key not working Product: Wine Version: CVS/GIT Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv AssignedTo: wine-bugs@winehq.org ReportedBy: fabio.capela@yahoo.com
Created an attachment (id=15960) --> (http://bugs.winehq.org/attachment.cgi?id=15960) assigns ISO_Level3_Shift as VK_RMENU in X11DRV_InitKeyboard
On Ubuntu 8.04, the right alt key generates ISO_Level3_Shift (keysym == 0xfe03), which wine doesn't currently recognize as the right alt button. Found the problem while playing World of Warcraft, where I wasn't able to use the right alt key to trigger actions mapped to a combination of alt and another button.
The attached patch changes X11DRV_InitKeyboard to handle ISO_Level3_Shift as VK_RMENU. This solves the problem for me, but I don't know if it's the proper way to handle this bug.
http://bugs.winehq.org/show_bug.cgi?id=15203
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
--- Comment #1 from Austin English austinenglish@gmail.com 2008-09-09 19:35:08 --- Please send patches to wine-patches@winehq.org
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #2 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-10 02:15:20 --- (In reply to comment #0)
Created an attachment (id=15960)
--> (http://bugs.winehq.org/attachment.cgi?id=15960) [details]
assigns ISO_Level3_Shift as VK_RMENU in X11DRV_InitKeyboard On Ubuntu 8.04, the right alt key generates ISO_Level3_Shift (keysym == 0xfe03), which wine doesn't currently recognize as the right alt button.
This sounds like a bug in Ubuntu keyboard layout. Right alt should generate XK_Alt_R (0xffea) keysym. Have you tried to report this to Ubuntu devs?
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #3 from Fábio Capela fabio.capela@yahoo.com 2008-09-10 09:35:32 --- (In reply to comment #2)
This sounds like a bug in Ubuntu keyboard layout. Right alt should generate XK_Alt_R (0xffea) keysym. Have you tried to report this to Ubuntu devs?
I haven't reported it to the Ubuntu devs, specially since I'm not sure it's a bug in their keyboard layouts.
From what I have read on the subject the proper keysym for the right alt in
keyboard layouts with altGr functionality (such as the one I use) is either Mode_switch (0xff7e) or ISO_Level3_Shift (0xfe03), depending on the X version; the previous (7.10) version of Ubuntu apparently used Mode_switch, whereas the current one (8.04) uses ISO_Level3_Shift.
Mode_switch is handled, at least partially, in Wine (it is given the same scancode as XK_Alt_R in the array nonchar_key_scan, although it doesn't have an associated VK in nonchar_key_vkey), but ISO_Level3_Shift is not.
BTW, I'll continue looking for info on this (I don't know where to find authoritative information on the subject), but from posts in the xkb@listserv.bat.ru list going back as far as 2004 I've got the feeling that binding Mode_switch to the right alt key is deprecated and should be replaced with ISO_Level3_Shift.
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-10 09:44:10 --- (In reply to comment #3)
From what I have read on the subject the proper keysym for the right alt in keyboard layouts with altGr functionality (such as the one I use) is either Mode_switch (0xff7e) or ISO_Level3_Shift (0xfe03), depending on the X version; the previous (7.10) version of Ubuntu apparently used Mode_switch, whereas the current one (8.04) uses ISO_Level3_Shift.
Neither Mode_switch nor ISO_Level3_Shift are guaranteed to be generated by pressing Right Alt, in fact, it's all keyboard mapping dependent.
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).
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #6 from Fábio Capela fabio.capela@yahoo.com 2008-09-10 13:39:04 --- I was thinking about this problem and noticed that fixing the right alt key to always send a VK_RMENU inside wine would break the usage of altGr to input modified characters; in light of it, this behavior seems like merely an example of the different behaviors of Linux and Windows, and not a bug that can be fixed.
(Incidentally, I think this is the reason Mode_switch sends the right alt scancode, but not the right alt vkey; it would break altGr usage the same way. Maybe a comment inside keyboard.c explaining why this can not be fixed would be in order.)
At least now I know why my right alt was not working with wine, and can craft a custom keymap to fix it for the one program where this matters to me (World of Warcraft).
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?
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #8 from Fábio Capela fabio.capela@yahoo.com 2008-09-11 07:46:28 --- (In reply to comment #7)
(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.
I stand corrected on this; as I said in my previous comment, I don't think anymore it's wise to attribute the right alt's VK to either Mode_switch or ISO_Level3_Shift. I think I'll just use a custom xmodmap config when using programs under wine that need that second alt key.
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.
If you take /usr/include/X11/keysymdef.h as a reference, that comment should be right before the /* FF80 */ line, not the /* FF78 */ one.
As for why it don't match, I would guess someone before me had this same idea of forcing the physical right alt key to always behave the way windows expects it to behave; that or else someone was peeved that the Mode_switch key was being translated to a key with scancode 0, and since Mode_switch was mapped to the right alt key in his system, decided to assign the same scancode.
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?
None that I remember or could find in my list of installed packages (although this system originally was either an Ubuntu 7.04 or Ubuntu 6.10, and before the G15 keyboard was supported I had to mess with the keyboard mapping to get it's multimedia keys to work; even though I tried to undo all my changes when the G15 became supported, there could be leftover bits from older versions on the config files).
A question, what are the keys you have to press to get symbols that are not in the keyface, such as Æ? Maybe the default key to enter the third shift state has been changed since 7.04, or you are using a mapping without third (or higher) shift state.
From what I saw on other mailing list archives, it seems that other distros
also map ISO_Level3_Shift to the right alt key, at least current debian seems to do so; it seems this keysym is now the recommended one to reach the third and fourth symbols associated with a single key.
http://bugs.winehq.org/show_bug.cgi?id=15203
--- Comment #9 from Dmitry Timoshkov dmitry@codeweavers.com 2008-09-11 09:47:48 --- (In reply to comment #8)
A question, what are the keys you have to press to get symbols that are not in the keyface, such as Æ? Maybe the default key to enter the third shift state has been changed since 7.04, or you are using a mapping without third (or higher) shift state.
I don't need that. All the characters I need are on the key caps. On the other hand I'm working on every keyboard related problem for our customers, and I find that current keyboard code in Wine works pretty well in many different configurations, with many different languages.
http://bugs.winehq.org/show_bug.cgi?id=15203
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #10 from Austin English austinenglish@gmail.com 2009-01-20 02:40:23 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=15203
Adys adys.wh+winehqdotorg@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh+winehqdotorg@gmail.c | |om
--- Comment #11 from Adys adys.wh+winehqdotorg@gmail.com 2009-01-21 18:10:25 --- (In reply to comment #10)
Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
This is working in git, has been since a few months.
http://bugs.winehq.org/show_bug.cgi?id=15203
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #12 from Austin English austinenglish@gmail.com 2009-01-21 20:08:27 --- Fixed.
http://bugs.winehq.org/show_bug.cgi?id=15203
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org 2009-01-30 11:04:26 --- Closing bugs fixed in 1.1.14.