Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

Remove key from Queue (Maya style)

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

Greetings! I was wondering, how could i remove the keypress/alt message form the message queue. I have written an DirectX wrapper with some helper functions and one of them simulates maya like behavior. If i include the method in my main loop, when an user holds ALT and uses mouse movement or buttons the scene gets rotated. My problem is, that I would like to remove that alt was even pressed. Why? Because it enables the Windows menus. I could take another key and wouldn't have the problems but anyway, since my friends use maya i would like to simulate it. What I would like to have is: 1.) When ALT is pressed and Mouse movement/button let me handle it 2.) If ALT is pressed and no mouse movement let windows handle it. Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
In your message handler callback, capture the WM_KEYDOWN (or the WM_SYSKEYDOWN event) and in the instance of ALT being pressed, return 0 from the handler rather than passing it on to the default callback to handle...

(you may also need to handle the WM_KEYUP and WM_SYSKEYUP events too)

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!