Advertisement Jump to content
Sign in to follow this  
korona

Blocking keys in directinput

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

I'm writing a background application that needs to react to keys being held down. I've used two approaches (still compile-time switchable in my application via a #define), the first one was windows low level input hooks (WH_KEYBOARD_LL and WH_MOUSE_LL). The problem with that was that every time the mouse hook gets installed, the mouse would lag terribly for at least five seconds. Why, I don't know. So I switched to DirectInput. That solved the lag problem and its working beautifully, except for one thing. With windows hooks, I could effectively block a mouse click for all other applications by simply not calling CallNextHook. With DirectInput I don't know hos to do this. I really want to be able to do it since if the user configures the back button of his mouse to be my applications hotkey, I don't want his browser to navigate back every time he clicks it. Am I making any sense? Does anyone know how to do this with DirectInput? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!