Sign in to follow this  
Samurai Jack

Remove key from Queue (Maya style)

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

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