https://bugs.winehq.org/show_bug.cgi?id=31899
--- Comment #14 from Sebastian Lackner sebastian@fds-team.de --- A fix was added to Wine-Staging: https://github.com/wine-compholio/wine-staging/tree/master/patches/server-Ke...
I ran a lot of manual tests with various self-written test applications and games, and came to the conclusion that my theory is right. Windows internally uses a locking mechanism of the thread input keystate, and under specific circumstances synchronizes it with the global keystate. Some things in the patch might look weird (for example that GetKeyboardState() does _NOT_ synchronize the keystate), but this matches very exactly what Windows does. Will try to clean up the tests during the next time, and integrate them somehow in the wine test suite.