[.net] held mouse button
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.
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.
Another option might be to use the static property System.Windows.Forms.Control.MouseButtons, perhaps along with the ModifierKeys and MousePosition properties as well.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement