Table of Contents

Class MouseDeviceState

Namespace
Stride.Input
Assembly
Stride.Input.dll

An extension to PointerDeviceState that handle mouse input and translates it to pointer input

public class MouseDeviceState
Inheritance
MouseDeviceState

Constructors

MouseDeviceState(PointerDeviceState, IMouseDevice)

public MouseDeviceState(PointerDeviceState pointerState, IMouseDevice mouseDevice)

Parameters

pointerState PointerDeviceState
mouseDevice IMouseDevice

Fields

Events

protected readonly List<InputEvent> Events

Field Value

List<InputEvent>

MouseDevice

protected IMouseDevice MouseDevice

Field Value

IMouseDevice

PointerState

protected PointerDeviceState PointerState

Field Value

PointerDeviceState

Properties

Delta

public Vector2 Delta { get; set; }

Property Value

Vector2

DownButtons

public IReadOnlySet<MouseButton> DownButtons { get; }

Property Value

IReadOnlySet<MouseButton>

Position

public Vector2 Position { get; set; }

Property Value

Vector2

PressedButtons

public IReadOnlySet<MouseButton> PressedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

ReleasedButtons

public IReadOnlySet<MouseButton> ReleasedButtons { get; }

Property Value

IReadOnlySet<MouseButton>

Methods

HandleButtonDown(MouseButton)

public void HandleButtonDown(MouseButton button)

Parameters

button MouseButton

HandleButtonUp(MouseButton)

public void HandleButtonUp(MouseButton button)

Parameters

button MouseButton

HandleMouseDelta(Vector2)

Special move that generates pointer events with just delta

public void HandleMouseDelta(Vector2 delta)

Parameters

delta Vector2

The movement delta

HandleMouseWheel(float)

public void HandleMouseWheel(float wheelDelta)

Parameters

wheelDelta float

HandleMove(Vector2)

Handles a single pointer move

public void HandleMove(Vector2 newPosition)

Parameters

newPosition Vector2

New position of the pointer

HandlePointerDown()

Handles a single pointer down

public void HandlePointerDown()

HandlePointerUp()

Handles a single pointer up

public void HandlePointerUp()

Update(List<InputEvent>)

Generate input events

public void Update(List<InputEvent> inputEvents)

Parameters

inputEvents List<InputEvent>