Handmade Hero»Forums»Code
2 posts
PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
Edited by GhostDetective on Reason: Initial post
For some reason, when I am holding down the LEFT and UP arrows, or the RIGHT and DOWN arrows, a third keyboard input of the SPACE bar being pressed will not add a message to the message queue that PeekMessage checks. However, when I am holding down two arrows in any other combination, the SPACE bar message is added to PeekMessage's queue, and is processed. Does anyone know why this might be the case?
511 posts
PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
That may just be your keyboard having internal layout which leads to some combination of keys not working right. A property more commonly known as key jamming. A feature that avoid the worse ghosting, where a phantom key appears to be pressed along side a certain combination of keys.

The fix is to get a better keyboard with better key jamming behavior.

2 posts
PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
You hit the nail on the head. I just remembered that I had an extra keyboard lying around, and sure enough, with a different keyboard all the inputs show up just fine. It was my laptop's keyboard that was having the key jamming issues. Thanks for the diagnosis!