Class Mouse
Provides access to mouse devices. Note: this API is not implemented yet.
Inherited Members
Namespace: OpenTK.Input
Assembly: OpenTK.dll
Syntax
public static class Mouse
Methods
GetCursorState()
Retreves the MouseState for the mouse cursor. The X and Y coordinates are defined in absolute desktop points, with the origin placed at the top-left corner of Default. Pointer ballistics (acceleration) are applied. Resolution is limited to the resolution of the DisplayDevice containing the cursor, typically between 96 and 120 DPI.
Declaration
public static MouseState GetCursorState()
Returns
Type | Description |
---|---|
MouseState | A MouseState structure representing the state of the mouse cursor. |
GetState()
Retrieves the combined MouseState for all specified mouse devices. The X, Y and wheel values are defined in a hardware-specific coordinate system. Pointer ballistics (acceleration) are NOT applied. Resolution is hardware-specific, typically between 200 and 2000 DPI. Use GetState(Int32) to retrieve the state of a specific mouse device. Use GetCursorState() to retrieve the absolute coordinates of the mouse cursor. Use MouseMove for event-based mouse input.
Declaration
public static MouseState GetState()
Returns
Type | Description |
---|---|
MouseState | A MouseState structure representing the combined state of all mouse devices. |
GetState(Int32)
Retrieves the MouseState for the specified mouse device. The X, Y and wheel values are defined in a hardware-specific coordinate system. Pointer ballistics (acceleration) are NOT applied. Resolution is hardware-specific, typically between 200 and 2000 DPI. Use GetState() to retrieve the combined state of all mouse devices. Use GetCursorState() to retrieve the absolute coordinates of the mouse cursor. Use MouseMove for event-based mouse input.
Declaration
public static MouseState GetState(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the mouse device. |
Returns
Type | Description |
---|---|
MouseState | A MouseState structure representing the state for the specified mouse device. |
SetPosition(Double, Double)
Moves the mouse cursor to the specified screen position.
Declaration
public static void SetPosition(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | A Double that represents the absolute x position of the cursor in screen coordinates. |
Double | y | A Double that represents the absolute y position of the cursor in screen coordinates. |