Struct MouseState
Encapsulates the state of a mouse device.
Implements
Inherited Members
Namespace: OpenTK.Input
Assembly: cs.temp.dll.dll
Syntax
public struct MouseState : IEquatable<MouseState>
Properties
IsAnyButtonDown
Gets a value indicating whether any button is down.
Declaration
public bool IsAnyButtonDown { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsConnected
Gets a value indicating whether this instance is connected.
Declaration
public bool IsConnected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Item[MouseButton]
Gets a System.Boolean indicating whether the specified MouseButton is pressed.
Declaration
public bool this[MouseButton button] { get; }
Parameters
Type | Name | Description |
---|---|---|
MouseButton | button | The MouseButton to check. |
Property Value
Type | Description |
---|---|
System.Boolean | True if key is pressed; false otherwise. |
LeftButton
Gets a System.Boolean indicating whether the left mouse button is pressed. This property is intended for XNA compatibility.
Declaration
public ButtonState LeftButton { get; }
Property Value
Type | Description |
---|---|
ButtonState |
MiddleButton
Gets a System.Boolean indicating whether the middle mouse button is pressed. This property is intended for XNA compatibility.
Declaration
public ButtonState MiddleButton { get; }
Property Value
Type | Description |
---|---|
ButtonState |
RightButton
Gets a System.Boolean indicating whether the right mouse button is pressed. This property is intended for XNA compatibility.
Declaration
public ButtonState RightButton { get; }
Property Value
Type | Description |
---|---|
ButtonState |
Scroll
Gets a MouseScroll instance, representing the current state of the mouse scroll wheel.
Declaration
public MouseScroll Scroll { get; }
Property Value
Type | Description |
---|---|
MouseScroll |
ScrollWheelValue
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.
Declaration
public int ScrollWheelValue { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Wheel
Gets the absolute wheel position in integer units. To support high-precision mice, it is recommended to use WheelPrecise instead.
Declaration
public int Wheel { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
WheelPrecise
Gets the absolute wheel position in floating-point units.
Declaration
public float WheelPrecise { get; }
Property Value
Type | Description |
---|---|
System.Single |
X
Gets an integer representing the absolute x position of the pointer, in window pixel coordinates.
Declaration
public int X { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
XButton1
Gets a System.Boolean indicating whether the first extra mouse button is pressed. This property is intended for XNA compatibility.
Declaration
public ButtonState XButton1 { get; }
Property Value
Type | Description |
---|---|
ButtonState |
XButton2
Gets a System.Boolean indicating whether the second extra mouse button is pressed. This property is intended for XNA compatibility.
Declaration
public ButtonState XButton2 { get; }
Property Value
Type | Description |
---|---|
ButtonState |
Y
Gets an integer representing the absolute y position of the pointer, in window pixel coordinates.
Declaration
public int Y { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Equals(MouseState)
Compares two MouseState instances.
Declaration
public bool Equals(MouseState other)
Parameters
Type | Name | Description |
---|---|---|
MouseState | other | The instance to compare two. |
Returns
Type | Description |
---|---|
System.Boolean | True, if both instances are equal; false otherwise. |
Equals(Object)
Compares to an object instance for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if this instance is equal to obj; false otherwise. |
Overrides
GetHashCode()
Generates a hashcode for the current instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A System.Int32 represting the hashcode for this instance. |
Overrides
IsButtonDown(MouseButton)
Gets a System.Boolean indicating whether this button is down.
Declaration
public bool IsButtonDown(MouseButton button)
Parameters
Type | Name | Description |
---|---|---|
MouseButton | button | The MouseButton to check. |
Returns
Type | Description |
---|---|
System.Boolean |
IsButtonUp(MouseButton)
Gets a System.Boolean indicating whether this button is up.
Declaration
public bool IsButtonUp(MouseButton button)
Parameters
Type | Name | Description |
---|---|---|
MouseButton | button | The MouseButton to check. |
Returns
Type | Description |
---|---|
System.Boolean |
ToString()
Returns a System.String that represents the current MouseState.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents the current MouseState. |
Overrides
Operators
Equality(MouseState, MouseState)
Checks whether two MouseState instances are equal.
Declaration
public static bool operator ==(MouseState left, MouseState right)
Parameters
Type | Name | Description |
---|---|---|
MouseState | left | A MouseState instance. |
MouseState | right | A MouseState instance. |
Returns
Type | Description |
---|---|
System.Boolean | True if both left is equal to right; false otherwise. |
Inequality(MouseState, MouseState)
Checks whether two MouseState instances are not equal.
Declaration
public static bool operator !=(MouseState left, MouseState right)
Parameters
Type | Name | Description |
---|---|---|
MouseState | left | A MouseState instance. |
MouseState | right | A MouseState instance. |
Returns
Type | Description |
---|---|
System.Boolean | True if both left is not equal to right; false otherwise. |