The real bug is that the thread still receives the message even though it has timed out on the sender side. The message should be cancelled in that case. I'll have a look at fixing that.
This will fix the 'bad key-press' event bug... But it will still mean that the game will miss a keyboard event (and in this case, it's the 'KeyRelease' event which will trigger exactly the same bug as before).
Lionel