This project is read-only.
1
Vote

Mouse Right Button State = FAIL?

description

I can't get the right mouse button to work... The weird thing is that I used it JUST like the left mouse button, and the left button responded fine. Here's the simplified version of my code:
 
using Microsoft.Xna.Framework.Input;
...
    MouseState mouseState, previousMouseState;
...
mouseState = Mouse.GetState();
if (mouseState.LeftButton == ButtonState.Pressed && previousMouseState.LeftButton == ButtonState.Released)
{
}
else if (mouseState.RightButton == ButtonState.Pressed && previousMouseState.RightButton == ButtonState.Released)
{
}
previousMouseState = mouseState;
 
I've tried the following:
  1. Commenting out the LeftButton checks + block of code
  2. Only checking the right button's state in the current mouse state
  3. Using Mouse.RightButtonDown
     
    Nothing works for the right mouse button... Please help/fix?
     
    The only way I could see this NOT being a problem with SilverSprite/XNA is if Silverlight is stealing the right mouse button state for whatever reason. I know that if you run an application in the browser and right click on it, a drop down menu appears with 1-2 options: "Silverlight", and (if in OOB mode) something like "Run OOB". Perhaps this is the case? If so, how can I fix it? (I have only tried running my application through Visual Studio while having this problem.)
     
    Thanks

comments