DirectInput Caps Lock Question
Is there a way to check the "state" of Caps Lock (active, lit vs. inactive, unlit). Or, does DirectInput merely check whether it is currently pressed or not?
From my travels I found it easiest just to keep track if caps lock is "active" or not. It shouldn''t be a problem if you''re using buffered input. If you''re not...let''s just hope you don''t miss a key-press
~Rob
~Rob
quote:Original post by SGreth
From my travels I found it easiest just to keep track if caps lock is "active" or not. It shouldn''t be a problem if you''re using buffered input. If you''re not...let''s just hope you don''t miss a key-press
~Rob
And how do you determine if it is "active"? As far as I know, I can only check for presses.
For now, my code just assumes that the caps lock is off and then each time it is hit I toggle a boolean in my code (indicating if capslock is on or off). I thought (once upon a time...) that I saw an example in the DX SDK where they actually toggle''d the state of capslock in code. I''m not sure where to find that example though...
~Rob
~Rob
quote:Original post by SGreth
For now, my code just assumes that the caps lock is off and then each time it is hit I toggle a boolean in my code (indicating if capslock is on or off). I thought (once upon a time...) that I saw an example in the DX SDK where they actually toggle''d the state of capslock in code. I''m not sure where to find that example though...
~Rob
Ok, thanks. That''s what I was doing. Just wondering if there was a better way.
My big fear is that someone is going to enter the game with Caps Lock on and then experience the bizarre backwards state of Caps Lock working in reverse.
GetKeyboardState will return the current state of the Caps Lock, Num Lock, and Scroll Lock toggle keys.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement