Sign in to follow this  

Direct input Key codes question

Recommended Posts

hello_there    122
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
circlesoft    1178
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this