Jump to content
  • Advertisement
Sign in to follow this  
utilae

How to detect fullstop in message pump?

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

Hi, I am using C++. How do I detect whether the fullstop key has been pushed, eg '.' ? To detect that I push escape I go: if(wParam==VK_ESCAPE) but how do I detect when I push fullstop?

Share this post


Link to post
Share on other sites
Advertisement
Ok, I can detect a full stop, but it gets mixed up with backspace and delete key. So I push fullstop and it deletes.

Share this post


Link to post
Share on other sites
I was detecting for the backspace and the delete key.

It wasn't picking up 190 as fullstop.

Instead 46 is fullstop, so 46 works.

Thanks.

Share this post


Link to post
Share on other sites
46 is the ASCII value for '.' (you get that from WM_CHAR).

190, VK_PERIOD is the code you will get from WM_KEYDOWN. I assumed this is what you were doing - as this is what you use VK_ESCAPE for. You shouldn't use VK_ codes with WM_CHAR.

An extra tip - instead of using the number 46, put the '.' in single quotation marks.

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.

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!