Interface IMouseComponent
Base interface for drivers which implement the mouse component.
Inherited Members
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public interface IMouseComponent : IPalComponent
Properties
CanSetMousePosition
If it's possible to set the position of the mouse using SetPosition(int, int).
Declaration
bool CanSetMousePosition { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
SupportsRawMouseMotion
If raw mouse motion is supported on this platform. If this is falseIsRawMouseMotionEnabled(WindowHandle) and EnableRawMouseMotion(WindowHandle, bool) should not be used.
Declaration
bool SupportsRawMouseMotion { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
EnableRawMouseMotion(WindowHandle, bool)
Enables or disables raw mouse motion for a specific window. When raw mouse motion is enabled the window will receive RawMouseMoveEventArgs events, in addition to the normal MouseMoveEventArgs events. Check that SupportsRawMouseMotion is true before using this.
Declaration
void EnableRawMouseMotion(WindowHandle window, bool enable)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | window | The window to enable or disable raw mouse motion for. |
bool | enable | Whether to enable or disable raw mouse motion. |
See Also
GetMouseState(out MouseState)
Fills the state
struct with the current mouse state.
Declaration
void GetMouseState(out MouseState state)
Parameters
Type | Name | Description |
---|---|---|
MouseState | state | The current mouse state. |
GetPosition(out int, out int)
Get the mouse cursor position.
Declaration
void GetPosition(out int x, out int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | X coordinate of the mouse in desktop space. |
int | y | Y coordinate of the mouse in desktop space. |
IsRawMouseMotionEnabled(WindowHandle)
Returns whether raw mouse motion is enabled for the given window or not. Check that SupportsRawMouseMotion is true before using this.
Declaration
bool IsRawMouseMotionEnabled(WindowHandle window)
Parameters
Type | Name | Description |
---|---|---|
WindowHandle | window | The window to query. |
Returns
Type | Description |
---|---|
bool | If raw mouse motion is enabled. |
See Also
SetPosition(int, int)
Set the mouse cursor position. Check that CanSetMousePosition is true before using this.
Declaration
void SetPosition(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | X coordinate of the mouse in desktop space. |
int | y | Y coordinate of the mouse in desktop space. |