Table of Contents

Interface IMouseDevice

Namespace
Stride.Input
Assembly
Stride.Input.dll

Represents functionality specific to mouse input such as buttons, wheels, mouse locking and setting cursor position

public interface IMouseDevice : IPointerDevice, IInputDevice
Inherited Members
Extension Methods

Properties

Delta

Mouse delta

Vector2 Delta { get; }

Property Value

Vector2

DownButtons

The mouse buttons that are down

IReadOnlySet<MouseButton> DownButtons { get; }

Property Value

IReadOnlySet<MouseButton>

IsPositionLocked

Gets or sets if the mouse is locked to the screen

bool IsPositionLocked { get; }

Property Value

bool

Position

Normalized position of the mouse inside the window

Vector2 Position { get; }

Property Value

Vector2

PressedButtons

The mouse buttons that have been pressed since the last frame

IReadOnlySet<MouseButton> PressedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

ReleasedButtons

The mouse buttons that have been released since the last frame

IReadOnlySet<MouseButton> ReleasedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

Methods

LockPosition(bool)

Locks the mouse position to the screen

void LockPosition(bool forceCenter = false)

Parameters

forceCenter bool

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

normalizedPosition Vector2

UnlockPosition()

Unlocks the mouse position if it was locked

void UnlockPosition()