http://bugs.winehq.org/show_bug.cgi?id=26489
Summary: GetKeyState does not work correctly with toggle keys (VK_CAPITAL, VK_NUMLOCK, VK_SCROLL) Product: Wine Version: 1.3.16 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: melekor@projectmagma.net
Created an attachment (id=33725) --> (http://bugs.winehq.org/attachment.cgi?id=33725) Tiny test program which demonstrates the problem (exe and C++ source)
The WINE implementation of GetKeyState does not follow the spec regarding "toggle keys" such as caps lock, num lock and scroll lock.
The documentation states: (about the return value) "If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled."
Instead, what WINE appears to do, is flip the low-order bit when a toggle-key is "un-toggled" (on=>off). When it is toggled (off=>on), the low order bit remains unaffected. This is obviously completely incorrect.
I have attached a demo app (zip file with exe with C++ source code) which shows the problem. When run on windows, it displays "CAPS ON" or "CAPS OFF" in sync with the little light on the keyboard. When run on WINE it does not stay in sync.
Tested on 1.2.2 and 1.3.16 on Ubuntu 10.10 Maverick Meerkat running in VirtualBox, host OS is Win7.
http://bugs.winehq.org/show_bug.cgi?id=26489
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2011-03-28 09:13:35 CDT --- It's toggled when the key is pressed, which should give the correct result. Your test app works fine here. You should probably test outside of VirtualBox.
http://bugs.winehq.org/show_bug.cgi?id=26489
--- Comment #2 from melekor@projectmagma.net 2011-03-28 20:04:48 CDT --- Well, those keys work fine in native Ubuntu apps not running under WINE. Seems to me if the problem was VirtualBox, then it would be showing up everywhere and not just WINE apps, no?
So perhaps the problem is between Ubuntu and WINE then. You said the test app worked fine, what was your test setup?
I will have access to a real non-virtualized Ubuntu some time later this week.
http://bugs.winehq.org/show_bug.cgi?id=26489
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=26489
Ken Thomases ken@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.winehq.org/show | |_bug.cgi?id=35907
https://bugs.winehq.org/show_bug.cgi?id=26489
--- Comment #3 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=26489
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com, | |winetest@luukku.com, | |xerox_xerox2000@yahoo.co.uk
--- Comment #4 from winetest@luukku.com --- (In reply to melekor from comment #2)
I will have access to a real non-virtualized Ubuntu some time later this week.
That was said 2011 and no reply back after that.
Fresh wineprefix, wine 2.12-git up to date. Pressing caps lock on and off works just fine with the test application. The text changes after every press. Same with wine-staging 2.12.
There is nothing to fix here?
https://bugs.winehq.org/show_bug.cgi?id=26489
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |plasil.tomas@seznam.cz
--- Comment #5 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- *** Bug 44047 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=26489
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com ---
Fresh wineprefix, wine 2.12-git up to date. Pressing caps lock on and off works just fine with the test application. The text changes after every press. Same with wine-staging 2.12.
There is nothing to fix here?
Reported as fixed.
If this isn't the case, please reopen.
https://bugs.winehq.org/show_bug.cgi?id=26489
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.10.