GetKeyboardState problems in Age of Empires II

Dmitry Timoshkov dmitry at baikal.ru
Thu Apr 18 01:32:19 CDT 2013


Stevie Trujillo <stevie.trujillo at gmail.com> wrote:

> "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.

dlls/winex11.drv/keyboard.c,X11DRV_KeymapNotify() should take care of that,
if it doesn't - please debug why (probably a bug in your WM).

-- 
Dmitry.



More information about the wine-devel mailing list