GetKeyboardState problems in Age of Empires II

Stevie Trujillo stevie.trujillo at gmail.com
Wed Apr 17 13:21:02 CDT 2013


"Age of Empires II scrolling gets stuck after Alt-Tab away
and back" ( http://bugs.winehq.org/show_bug.cgi?id=30814 ) has been
debugged now.

The problem is that GetKeyboardState starts returning 0x40 after
changing window. Documentation seems to only define LSB and MSB
( http://msdn.microsoft.com/en-us/library/windows/desktop/ms646299(v=vs.85).aspx
). This leads Age of Empires II to believe that all keys are pressed
after changing window, making it scroll unstoppably.

Should this be fixed by removing extra bits in GetKeyboardState like in
the bugzilla entry, or should it be fixed in wineserver? Also does
the similar functions GetAsyncKeyboardState() and GetKeyState() need
fixing?



Another (minor) problem raised in the bugzilla entry is that, if a key
is pressed when changing window, and released before returning,
GetKeyboardState() will claim the key is still pressed (0x80). But this
is easy to workaround, just hit the key again inside the game and it
will stop scrolling.



More information about the wine-devel mailing list