[Bug 45148] [Overwatch] Left Ctrl does not work

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Nov 14 03:12:46 CST 2018


https://bugs.winehq.org/show_bug.cgi?id=45148

--- Comment #23 from Dan Oliver <thrift24 at gmail.com> ---
Not a wine or windows developer, but do these lines potentially show the
problem?

002a:trace:key:X11DRV_KeyEvent type 2, window 3800005, state 0x0010, keycode 37
002a:trace:key:X11DRV_KeyEvent XmbLookupString needs 0 byte(s)
002a:trace:key:X11DRV_KeyEvent nbyte = 0, status 3
002a:trace:key:X11DRV_KeyEvent KeyPress : keysym=ffe3 (Control_L), # of chars=0
/ ""
002a:trace:key:EVENT_event_to_vkey e->keycode = 37
002a:trace:key:X11DRV_KeyEvent keycode 37 converted to vkey 0xA2 scan 1d
002a:trace:key:X11DRV_send_keyboard_input hwnd 0x20050 vkey=00a2 scan=001d
flags=0000
002a:trace:key:TranslateMessage Translating key VK_CONTROL (0011), scancode
001d
002a:trace:key:X11DRV_ToUnicodeEx ControlMask = 0004
002a:trace:key:X11DRV_ToUnicodeEx NumLockMask = 0010
002a:trace:key:X11DRV_ToUnicodeEx AltGrMask = 0010
002a:trace:key:X11DRV_ToUnicodeEx (0011, 001D) : faked state = 0x0014
002a:warn:key:X11DRV_ToUnicodeEx Unknown virtual key 11 !!!

According to Microsoft's documentation virtual key 11 is CTRL:

https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes

It seems like ToUnicodeEx is supposed to translate the vkey code (11) to the
unicode character based on the locale... which maybe makes sense that it can't
translate CTRL to a unicode character?  But maybe the return code isn't going
quite properly in the case that it can't covert?

I see a very old patch here that looks like wine was at least at one point not
returning the proper ret value for an unknown key:
http://wine.1045685.n8.nabble.com/user32-ToUnicodeEx-should-return-0-for-an-unknown-key-td1731103.html
... Obviously this is too old for the current code base:

https://github.com/wine-mirror/wine/blob/master/dlls/winex11.drv/keyboard.c

I was going to try to throw a return(0) in there rather than a break where the
error message is printed out, but I'm having trouble even getting overwatch to
compile/run properly at the moment and am not sure I will have a lot of time to
try it soon, so maybe someone else can just throw in a return there on a lark
to see if it might help?  Even if it works it probably isn't the right thing,
but maybe it would be useful in providing a direction for a real patch if it
happens to work.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list