Shift
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Pages
Shift.Input.MouseState Struct Reference

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

Public Member Functions

 MouseState (int x, int y, int scrollWheel, ButtonState leftButton, ButtonState middleButton, ButtonState rightButton, ButtonState xButton1, ButtonState xButton2)
 Initializes a new instance of the MouseState. More...
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified object. More...
 
override int GetHashCode ()
 Gets the hash code for MouseState instance. More...
 

Static Public Member Functions

static bool operator== (MouseState left, MouseState right)
 Compares whether two MouseState instances are equal. More...
 
static bool operator!= (MouseState left, MouseState right)
 Compares whether two MouseState instances are not equal. More...
 

Public Attributes

int _x
 
int _y
 
int _scrollWheelValue
 
ButtonState _leftButton
 
ButtonState _rightButton
 
ButtonState _middleButton
 
ButtonState _xButton1
 
ButtonState _xButton2
 

Static Public Attributes

static MouseState Default = new MouseState()
 

Properties

int X [get, set]
 Gets horizontal position of the cursor in relation to the window. More...
 
int Y [get, set]
 Gets vertical position of the cursor in relation to the window. More...
 
Point Position [get]
 Gets cursor position. More...
 
ButtonState LeftButton [get, set]
 Gets state of the left mouse button. More...
 
ButtonState MiddleButton [get, set]
 Gets state of the middle mouse button. More...
 
ButtonState RightButton [get, set]
 Gets state of the right mouse button. More...
 
int ScrollWheelValue [get, set]
 Returns cumulative scroll wheel value since the game start. More...
 
ButtonState XButton1 [get, set]
 Gets state of the XButton1. More...
 
ButtonState XButton2 [get, set]
 Gets state of the XButton2. More...
 

Detailed Description

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

Definition at line 12 of file MouseState.cs.

Constructor & Destructor Documentation

Shift.Input.MouseState.MouseState ( int  x,
int  y,
int  scrollWheel,
ButtonState  leftButton,
ButtonState  middleButton,
ButtonState  rightButton,
ButtonState  xButton1,
ButtonState  xButton2 
)
inline

Initializes a new instance of the MouseState.

Parameters
xHorizontal position of the mouse in relation to the window.
yVertical position of the mouse in relation to the window.
scrollWheelMouse scroll wheel's value.
leftButtonLeft mouse button's state.
middleButtonMiddle mouse button's state.
rightButtonRight mouse button's state.
xButton1XBUTTON1's state.
xButton2XBUTTON2's state.

Normally Mouse.GetState() should be used to get mouse current state. The constructor is provided for simulating mouse input.

Definition at line 36 of file MouseState.cs.

Member Function Documentation

override bool Shift.Input.MouseState.Equals ( object  obj)
inline

Compares whether current instance is equal to specified object.

Parameters
objThe MouseState to compare.
Returns

Definition at line 88 of file MouseState.cs.

override int Shift.Input.MouseState.GetHashCode ( )
inline

Gets the hash code for MouseState instance.

Returns
Hash code of the object.

Definition at line 99 of file MouseState.cs.

static bool Shift.Input.MouseState.operator!= ( MouseState  left,
MouseState  right 
)
inlinestatic

Compares whether two MouseState instances are not equal.

Parameters
leftMouseState instance on the left of the equal sign.
rightMouseState instance on the right of the equal sign.
Returns
true if the objects are not equal; false otherwise.

Definition at line 78 of file MouseState.cs.

static bool Shift.Input.MouseState.operator== ( MouseState  left,
MouseState  right 
)
inlinestatic

Compares whether two MouseState instances are equal.

Parameters
leftMouseState instance on the left of the equal sign.
rightMouseState instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

Definition at line 62 of file MouseState.cs.

Member Data Documentation

ButtonState Shift.Input.MouseState._leftButton

Definition at line 16 of file MouseState.cs.

ButtonState Shift.Input.MouseState._middleButton

Definition at line 18 of file MouseState.cs.

ButtonState Shift.Input.MouseState._rightButton

Definition at line 17 of file MouseState.cs.

int Shift.Input.MouseState._scrollWheelValue

Definition at line 15 of file MouseState.cs.

int Shift.Input.MouseState._x

Definition at line 14 of file MouseState.cs.

ButtonState Shift.Input.MouseState._xButton1

Definition at line 19 of file MouseState.cs.

ButtonState Shift.Input.MouseState._xButton2

Definition at line 20 of file MouseState.cs.

int Shift.Input.MouseState._y

Definition at line 14 of file MouseState.cs.

MouseState Shift.Input.MouseState.Default = new MouseState()
static

Definition at line 22 of file MouseState.cs.

Property Documentation

ButtonState Shift.Input.MouseState.LeftButton
getset

Gets state of the left mouse button.

Definition at line 146 of file MouseState.cs.

ButtonState Shift.Input.MouseState.MiddleButton
getset

Gets state of the middle mouse button.

Definition at line 158 of file MouseState.cs.

Point Shift.Input.MouseState.Position
get

Gets cursor position.

Definition at line 138 of file MouseState.cs.

ButtonState Shift.Input.MouseState.RightButton
getset

Gets state of the right mouse button.

Definition at line 170 of file MouseState.cs.

int Shift.Input.MouseState.ScrollWheelValue
getset

Returns cumulative scroll wheel value since the game start.

Definition at line 182 of file MouseState.cs.

int Shift.Input.MouseState.X
getset

Gets horizontal position of the cursor in relation to the window.

Definition at line 108 of file MouseState.cs.

ButtonState Shift.Input.MouseState.XButton1
getset

Gets state of the XButton1.

Definition at line 194 of file MouseState.cs.

ButtonState Shift.Input.MouseState.XButton2
getset

Gets state of the XButton2.

Definition at line 209 of file MouseState.cs.

int Shift.Input.MouseState.Y
getset

Gets vertical position of the cursor in relation to the window.

Definition at line 123 of file MouseState.cs.


The documentation for this struct was generated from the following file: