Remove key from Queue (Maya style)

Started by
0 comments, last by FReY 19 years, 2 months ago
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?
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)
do unto others... and then run like hell.

This topic is closed to new replies.

Advertisement