OT: Wondering what causes the difference in return values of GetKeyState between Linux / Windows. Anyone knows?
The Windows-version (through the widgetset) calls the GetKeyState-API. It's really simple.
The GTK2 version does a lot more things and tries to emulate (I think) the Windows GetKeyState-API. But apparently they used a mask of -128 ($FF80) to mark the bits and pieces ending up in a different value.
const
StateDown = SmallInt($FF80);
Maybe that should have been $8000 for complete compatibility.
(and for those who think it's not "emulating" Windows.... this function is in gtk3
winapi.inc
)