Archived

This topic is now archived and is closed to further replies.

DirectInput Caps Lock Question

This topic is 5274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
quote:
Original post by Mastaba
GetKeyboardState will return the current state of the Caps Lock, Num Lock, and Scroll Lock toggle keys.


As "active" or "inactive"? I was under the impression it returns whether they are pressed or not.


Share this post


Link to post
Share on other sites