I see another potential problem with this solition. Imagine I am using VK_UP as my ‘move forwards’ and VK_Z as my fire key. If I want to move forwards whilst continuously fireing, the player would hold both keys down.
so in the event key you get
VK_UP pressed VK_Z pressed VK_UP released VK_Z released VK_UP pressed VK_Z pressed VK_UP released VK_Z released
now, when you get to the VK_UP released it’s fine, scan for the next KEY_PRESSED and you get VK_UP, so you ignore it, then you get the VK_Z released and check, but unless you can consume the VK_UP pressed event, you’ll find that again. Is it possible/wise to start consuming events that arn’t at the front of the queue and have not been dispatched. Possible is easy to solve, try it (which I plan on doing, but not now), wise is another issue. What are the implications of removing a key pressed even, noting that when you are doing it, some things may have already been notified of the key released, and others may not (who knows where you are in the chain of listeners).
Just some thoughts.
Endolf