Sign in to follow this  

Remove key from Queue (Maya style)

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

This topic is 4724 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.

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