IMouseDevice Interface
Namespace: Stride.InputAssembly: Stride.Input.dll
Represents functionality specific to mouse input such as buttons, wheels, mouse locking and setting cursor position
public interface IMouseDevice : IPointerDevice, IInputDevice
| Name | Description | |
|---|---|---|
| Properties | ||
| Delta | Mouse delta |
|
| DownButtons | The mouse buttons that are down |
|
| IsPositionLocked | Gets or sets if the mouse is locked to the screen |
|
| Position | Normalized position of the mouse inside the window |
|
| PressedButtons | The mouse buttons that have been pressed since the last frame |
|
| ReleasedButtons | The mouse buttons that have been released since the last frame |
|
| Methods | ||
| LockPosition(Boolean) | Locks the mouse position to the screen |
|
| SetPosition(Vector2) | Attempts to set the pointer position, this only makes sense for mouse pointers |
|
| UnlockPosition() | Unlocks the mouse position if it was locked |
|
Properties
Delta
Mouse delta
Vector2 Delta { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
DownButtons
The mouse buttons that are down
IReadOnlySet<MouseButton> DownButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<MouseButton> |
IsPositionLocked
Gets or sets if the mouse is locked to the screen
bool IsPositionLocked { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Position
Normalized position of the mouse inside the window
Vector2 Position { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
PressedButtons
The mouse buttons that have been pressed since the last frame
IReadOnlySet<MouseButton> PressedButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<MouseButton> |
ReleasedButtons
The mouse buttons that have been released since the last frame
IReadOnlySet<MouseButton> ReleasedButtons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlySet<MouseButton> |
Methods
LockPosition(Boolean)
Locks the mouse position to the screen
void LockPosition(bool forceCenter = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | forceCenter | Force the mouse position to the center of the screen |
SetPosition(Vector2)
Attempts to set the pointer position, this only makes sense for mouse pointers
void SetPosition(Vector2 normalizedPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | normalizedPosition |
UnlockPosition()
Unlocks the mouse position if it was locked
void UnlockPosition()