Jump to content
  • Advertisement
Sign in to follow this  
hello_there

Direct input Key codes question

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

Is there a function that lets you pass in a string or character array and returns the integer for that key. eg you pass in "DIK_SPACE" and you get back 57. Or am i going to have to right it myself? I want it so in my settings files i can put DIK_SPACE and when the setting is loaded in it gets converted to an integer so i can use it.

Share this post


Link to post
Share on other sites
Advertisement
If you want to do keyboard typing, you may want to try using the WM_CHAR Windows Message instead of DirectInput. The native Windows keyboard handler does a lot of things that DirectInput doesn't do, such as:

- Translation to any installed keymap language
- IME support for Chinese-like languages
- Special keyboards
- User keyboard repeat settings are still used

It's actually much, much easier to just sit on the WM_CHAR message than try to sort out keyboard input from DInput. The good thing is, though, that you can switch right back to DInput for all of your game-only stuff.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!