Jump to content
  • Advertisement
Sign in to follow this  
danromeo

[.net] held mouse button

This topic is 4127 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 VR app in C# and I want the user to walk forward when holding down the right mouse button. Using MouseDown and then polling for which button is pushed doesn't work because it would require the user to continuously push the button. MouseHover doesn't work because it takes a SystemEvent arguement and can't poll for which button is pushed. MouseMove doesn't work because I need this functionality even if the mouse hasn't moved. What's the best way to detect a "held" mouse button? Sorry for the stupid question, but somebody's gotta ask 'em, dammit.

Share this post


Link to post
Share on other sites
Advertisement
I might personally just catch MouseDown and MouseUp events, and manually track the mouse's state myself. Capturing the mouse can help with this, too.

Another option might be to use the static property System.Windows.Forms.Control.MouseButtons, perhaps along with the ModifierKeys and MousePosition properties as well.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!