Hi, the documentation for these two functions isn't clear about the contents of the bits of the return value, except the highest and lowest bit. Some programs assume that these are always set to zero, which seems to be the actual behavior in Windows.
Specifically, this leads to stuck keys in "Age of Empires 2 HD" and "Age of Empires 2: Definitive Edition" when tabbing out as reported in https://bugs.winehq.org/show_bug.cgi?id=30814 .
The following patch makes sure that all undefined bits are set to zero.
Markus
Markus Engel (2): user32: Force bits in GetKeyState() and GetKeyboardState() to zero. user32/tests: Add more tests for GetKeyState().
dlls/user32/input.c | 8 +++++++- dlls/user32/tests/input.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-)