Jump to content
  • Advertisement
Sign in to follow this  
Maddibob

Mouse events

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

Hello I have a normal MFC MDI setup with a Direct X8 swap chain controlling views to each window. I use an LPDIRECTINPUTDEVICE8 pointer for my mouse and when the rigth mouse button is pressed, I call Acquire(), do some movement actions and then Unacquire(). This all works nicely and I can move the mouse continually forward without Windows stopping it at the top of the screen... The problem is that whilst the mouse is acquired, you can click on the left mouse button which will still send events to Windows. This becomes apparent when you click and hold the left mouse button whilst the right mouse button is already held (my program allows you to move and drag things with both or either of the mouse buttons) - if you click and drag the left button whilst on the title bar of the window, once you Unacquire() the mouse, Windows kicks in and moves the window. This is obviously not what I want, so is there any way of disabling Windows messages whilst the mouse is acquired? I can pass a flag down to the underlying framework (CMDIChildWnd, etc) to let it know I have control of the mouse, but I can't seem to find anything. Any help would be gratefully received. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Try calling the IDirectInputDevice8::SetCooperativeLevel() method with the DISCL_EXCLUSIVE flag set. This prevents windows from using the mouse while it is acquired.

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!