Table of Contents

Class MouseDeviceBase

Namespace
Stride.Input
Assembly
Stride.Input.dll

Base class for mouse devices, implements some common functionality of IMouseDevice, inherits from PointerDeviceBase

public abstract class MouseDeviceBase : PointerDeviceBase, IMouseDevice, IPointerDevice, IInputDevice
Inheritance
MouseDeviceBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

MouseDeviceBase()

protected MouseDeviceBase()

Fields

MouseState

protected MouseDeviceState MouseState

Field Value

MouseDeviceState

Properties

Delta

Mouse delta

public Vector2 Delta { get; }

Property Value

Vector2

DownButtons

The mouse buttons that are down

public IReadOnlySet<MouseButton> DownButtons { get; }

Property Value

IReadOnlySet<MouseButton>

IsPositionLocked

Gets or sets if the mouse is locked to the screen

public abstract bool IsPositionLocked { get; }

Property Value

bool

Position

Normalized position of the mouse inside the window

public Vector2 Position { get; }

Property Value

Vector2

PressedButtons

The mouse buttons that have been pressed since the last frame

public IReadOnlySet<MouseButton> PressedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

ReleasedButtons

The mouse buttons that have been released since the last frame

public IReadOnlySet<MouseButton> ReleasedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

Methods

LockPosition(bool)

Locks the mouse position to the screen

public abstract 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

public abstract void SetPosition(Vector2 normalizedPosition)

Parameters

normalizedPosition Vector2

UnlockPosition()

Unlocks the mouse position if it was locked

public abstract void UnlockPosition()

Update(List<InputEvent>)

Updates the input device, filling the list inputEvents with input events that were generated by this device this frame

public override void Update(List<InputEvent> inputEvents)

Parameters

inputEvents List<InputEvent>

A list that gets filled with input events that were generated since the last frame

Remarks

Input devices are always updated after their respective input source