Jump to content
  • Advertisement

Archived

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

skyfire360

Only caps?

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

I''ve written a function to return a key if it is pressed: [source] int ReturnKey() { for (int i = 0; i < 127; i++) { if (!keys && pressedKeys[i]) { pressedKeys[i] = false; } } for (int j = 0; j < 127; j++) { if (keys[j] && !pressedKeys[j]) { pressedKeys[j] = true; return j; } } return -1; } [\source] The one problem is, it ALWAYS return uppercase values. Is there any easier way to get user input from the keyboard? I am using it in a console, and am trying to get user input. Any suggestions? Thanks -+=SkyFire360

Share this post


Link to post
Share on other sites
Advertisement
i guess you can use "getchar" or "getc". or check the status of the "shift" key if your are using DOS.

Share this post


Link to post
Share on other sites
Nope, this is using the NEHE base code. All I want is when someone hits the ''g'' key or the ''k'' key or any other key, I want the console to say "gk" or whatever. It is coming out "GK". Are there any good input routines?

-S`kyFire360

Share this post


Link to post
Share on other sites
If in the ''WndProc'' function you add ''WM_CHAR'' and do your keyboard capture there, it will be case sensitive.

Take Care,

Nyko

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!