The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Input.MouseState Struct Reference

Encapsulates the state of a mouse device. More...

Inherits IEquatable< MouseState >.

Public Member Functions

bool IsButtonDown (MouseButton button)
 Gets a System.Boolean indicating whether this button is down. More...
 
bool IsButtonUp (MouseButton button)
 Gets a System.Boolean indicating whether this button is up. More...
 
override bool Equals (object obj)
 Compares to an object instance for equality. More...
 
override int GetHashCode ()
 Generates a hashcode for the current instance. More...
 
bool Equals (MouseState other)
 Compares two MouseState instances. More...
 

Static Public Member Functions

static bool operator== (MouseState left, MouseState right)
 Checks whether two MouseState instances are equal. More...
 
static bool operator!= (MouseState left, MouseState right)
 Checks whether two MouseState instances are not equal. More...
 
static void ValidateOffset (int offset)
 

Public Attributes

const int IntSize = sizeof(int)
 
const int NumInts = ((int)MouseButton.LastButton + IntSize - 1) / IntSize
 
unsafe fixed int Buttons [NumInts]
 
int x
 
int y
 
float wheel
 
bool is_connected
 

Properties

bool this[MouseButton button] [get, set]
 Gets a System.Boolean indicating whether the specified OpenTK.Input.MouseButton is pressed. More...
 
int Wheel [get]
 Gets the absolute wheel position in integer units. To support high-precision mice, it is recommended to use WheelPrecise instead. More...
 
float WheelPrecise [get, set]
 Gets the absolute wheel position in floating-point units. More...
 
int X [get, set]
 Gets an integer representing the absolute x position of the pointer, in window pixel coordinates. More...
 
int Y [get, set]
 Gets an integer representing the absolute y position of the pointer, in window pixel coordinates. More...
 
ButtonState LeftButton [get]
 Gets a System.Boolean indicating whether the left mouse button is pressed. This property is intended for XNA compatibility. More...
 
ButtonState MiddleButton [get]
 Gets a System.Boolean indicating whether the middle mouse button is pressed. This property is intended for XNA compatibility. More...
 
ButtonState RightButton [get]
 Gets a System.Boolean indicating whether the right mouse button is pressed. This property is intended for XNA compatibility. More...
 
ButtonState XButton1 [get]
 Gets a System.Boolean indicating whether the first extra mouse button is pressed. This property is intended for XNA compatibility. More...
 
ButtonState XButton2 [get]
 Gets a System.Boolean indicating whether the second extra mouse button is pressed. This property is intended for XNA compatibility. More...
 
int ScrollWheelValue [get]
 Gets the absolute wheel position in integer units. This property is intended for XNA compatibility. To support high-precision mice, it is recommended to use WheelPrecise instead. More...
 
bool IsConnected [get, set]
 

Detailed Description

Encapsulates the state of a mouse device.

Member Function Documentation

override bool OpenTK.Input.MouseState.Equals ( object  obj)

Compares to an object instance for equality.

Parameters
objThe System.Object to compare to.
Returns
True if this instance is equal to obj; false otherwise.
bool OpenTK.Input.MouseState.Equals ( MouseState  other)

Compares two MouseState instances.

Parameters
otherThe instance to compare two.
Returns
True, if both instances are equal; false otherwise.
override int OpenTK.Input.MouseState.GetHashCode ( )

Generates a hashcode for the current instance.

Returns
A System.Int32 represting the hashcode for this instance.
bool OpenTK.Input.MouseState.IsButtonDown ( MouseButton  button)

Gets a System.Boolean indicating whether this button is down.

Parameters
buttonThe OpenTK.Input.MouseButton to check.
bool OpenTK.Input.MouseState.IsButtonUp ( MouseButton  button)

Gets a System.Boolean indicating whether this button is up.

Parameters
buttonThe OpenTK.Input.MouseButton to check.
static bool OpenTK.Input.MouseState.operator!= ( MouseState  left,
MouseState  right 
)
static

Checks whether two MouseState instances are not equal.

Parameters
leftA MouseState instance.
rightA MouseState instance.
Returns
True if both left is not equal to right; false otherwise.
static bool OpenTK.Input.MouseState.operator== ( MouseState  left,
MouseState  right 
)
static

Checks whether two MouseState instances are equal.

Parameters
leftA MouseState instance.
rightA MouseState instance.
Returns
True if both left is equal to right; false otherwise.

Property Documentation

ButtonState OpenTK.Input.MouseState.LeftButton
get

Gets a System.Boolean indicating whether the left mouse button is pressed. This property is intended for XNA compatibility.

ButtonState OpenTK.Input.MouseState.MiddleButton
get

Gets a System.Boolean indicating whether the middle mouse button is pressed. This property is intended for XNA compatibility.

ButtonState OpenTK.Input.MouseState.RightButton
get

Gets a System.Boolean indicating whether the right mouse button is pressed. This property is intended for XNA compatibility.

int OpenTK.Input.MouseState.ScrollWheelValue
get

Gets the absolute wheel position in integer units. This property is intended for XNA compatibility. To support high-precision mice, it is recommended to use WheelPrecise instead.

bool OpenTK.Input.MouseState.this[MouseButton button]
getset

Gets a System.Boolean indicating whether the specified OpenTK.Input.MouseButton is pressed.

Parameters
buttonThe OpenTK.Input.MouseButton to check.
Returns
True if key is pressed; false otherwise.
int OpenTK.Input.MouseState.Wheel
get

Gets the absolute wheel position in integer units. To support high-precision mice, it is recommended to use WheelPrecise instead.

float OpenTK.Input.MouseState.WheelPrecise
getset

Gets the absolute wheel position in floating-point units.

int OpenTK.Input.MouseState.X
getset

Gets an integer representing the absolute x position of the pointer, in window pixel coordinates.

ButtonState OpenTK.Input.MouseState.XButton1
get

Gets a System.Boolean indicating whether the first extra mouse button is pressed. This property is intended for XNA compatibility.

ButtonState OpenTK.Input.MouseState.XButton2
get

Gets a System.Boolean indicating whether the second extra mouse button is pressed. This property is intended for XNA compatibility.

int OpenTK.Input.MouseState.Y
getset

Gets an integer representing the absolute y position of the pointer, in window pixel coordinates.