Handmade Hero » Forums » Code » PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
GhostDetective
2 posts
#20808 PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
4 months, 3 weeks ago Edited by GhostDetective on March 27, 2019, 3:42 p.m. 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?
ratchetfreak
461 posts
#20810 PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
4 months, 3 weeks ago

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.

GhostDetective
2 posts
#20811 PeekMessage() not picking up on all the keyboard inputs in win32_handmade.cpp
4 months, 3 weeks ago

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!