I read that GetAsyncKeyState has a bug, hence DirectInput doesn't use it. I thought DI is higher-level than GAKS, not to mention that's a huge bug to not be using something you made. Also, google only thinks the WINE GAKS has/had a bug. Is this true?
I doubt that any bug is the reason DI doesn't use GAKS. I'd say it's more about how DI bypasses the core Windows event handling, and how GAKS only allows you to query one key at a time, whereas DI has functions that return a bitmap for all key states at once.
Also, a bug, in this function? Until you hear a more detailed description of what the bug is, don't believe it.
It's very possible that WINE's GAKS had a bug. It's much less likely that it still has one. But in the case of WINE, it's easy to search their bug DB. A search for GetAsyncKeyState turns up three bugs. One seems to be irrelevant, the other two point to two bugs:
1) GAKS's state table doesn't get updated when the program doesn't have focus. This is because X simply doesn't tell background programs about keyboard events, so WINE can't know the state. This bug is confirmed and open.
2) GAKS doesn't report arrow keys. This bug is unconfirmed.
The root of the problem is that GAKS under WINE isnt directly part of the OS's keyboard drivers. WINE is ultimately just a windows emulator.
Actually WINE stands for: Wine Is Not an Emulator. Its a compatibility layer.
A dogpile by any other name...
The issue remains the same.
I'm not sure I would want to give WINE'd programs full control over my keyboard for every application anyway . . . . :)