MouseState Structure (Microsoft.Xna.Framework.Input)

Represents a mouse state with cursor position and button press information.

Namespace: Microsoft.Xna.Framework.Input
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1018)
  • C#
  • VB
  • F#
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = -1, Size = -1)]
public struct MouseState

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The MouseState type exposes the following members.

  Platforms Name Description
HorizontalScrollWheelValue Returns the cumulative horizontal scroll wheel value since the game start 
LeftButton Gets state of the left mouse button. 
MiddleButton Gets state of the middle mouse button. 
Position Gets cursor position. 
RightButton Gets state of the right mouse button. 
ScrollWheelValue Returns cumulative scroll wheel value since the game start. 
X Gets horizontal position of the cursor in relation to the window. 
XButton1 Gets state of the XButton1. 
XButton2 Gets state of the XButton2. 
Y Gets vertical position of the cursor in relation to the window. 
Top
  Platforms Name Description
Equals Compares whether current instance is equal to specified object. (Overrides ValueType.Equals().)
GetHashCode Gets the hash code for MouseState instance. (Overrides ValueType.GetHashCode().)
Top
  Platforms Name Description
Equality Compares whether two MouseState instances are equal. 
Inequality Compares whether two MouseState instances are not equal. 
Top
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web