Jump to content
  • Advertisement

Archived

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

The Frugal Gourmet

DirectInput Caps Lock Question

This topic is 5486 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

Advertisement
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
GetKeyboardState will return the current state of the Caps Lock, Num Lock, and Scroll Lock toggle keys.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!