Table of Contents

Class PointerDeviceState

Namespace
Stride.Input
Assembly
Stride.Input.dll

Contains logic to generate pointer events and store the resulting state

public class PointerDeviceState
Inheritance
PointerDeviceState

Constructors

PointerDeviceState(IPointerDevice)

public PointerDeviceState(IPointerDevice pointerDevice)

Parameters

pointerDevice IPointerDevice

Fields

PointerDatas

public readonly List<PointerDeviceState.PointerData> PointerDatas

Field Value

List<PointerDeviceState.PointerData>

PointerInputEvents

public readonly List<PointerDeviceState.InputEvent> PointerInputEvents

Field Value

List<PointerDeviceState.InputEvent>

SourceDevice

public IPointerDevice SourceDevice

Field Value

IPointerDevice

Properties

DownPointers

public IReadOnlySet<PointerPoint> DownPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

InverseSurfaceSize

public Vector2 InverseSurfaceSize { get; }

Property Value

Vector2

PressedPointers

public IReadOnlySet<PointerPoint> PressedPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

ReleasedPointers

public IReadOnlySet<PointerPoint> ReleasedPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

SurfaceAspectRatio

public float SurfaceAspectRatio { get; }

Property Value

float

SurfaceSize

public Vector2 SurfaceSize { get; }

Property Value

Vector2

Methods

GetPointerData(int)

Retrueves a pointer data structure unqiue to the given pointer ID

public PointerDeviceState.PointerData GetPointerData(int pointerId)

Parameters

pointerId int

Returns

PointerDeviceState.PointerData

ProcessPointerEvent(InputEvent)

Processes a PointerDeviceState.InputEvent, converting it to a PointerEvent. Also calls OnPointer and updates CurrentPointerEvents

public PointerEvent ProcessPointerEvent(PointerDeviceState.InputEvent evt)

Parameters

evt PointerDeviceState.InputEvent

Returns

PointerEvent

SetSurfaceSize(Vector2)

Updates the surface size of the pointing device, updates SurfaceSize, SurfaceAspectRatio, InverseSurfaceSize and calls SurfaceSizeChanged

public void SetSurfaceSize(Vector2 newSize)

Parameters

newSize Vector2

New size of the surface

Update(List<InputEvent>)

Generate input events

public void Update(List<InputEvent> inputEvents)

Parameters

inputEvents List<InputEvent>

UpdatePointerState(PointerEvent, bool)

Updates a pointer event with position / type / id set and updates the storted pointer data

public void UpdatePointerState(PointerEvent evt, bool updateDelta = true)

Parameters

evt PointerEvent
updateDelta bool