Table of Contents

Class PointerDeviceBase

Namespace
Stride.Input
Assembly
Stride.Input.dll

Base class for pointer devices

public abstract class PointerDeviceBase : IPointerDevice, IInputDevice
Inheritance
PointerDeviceBase
Implements
Derived

Constructors

PointerDeviceBase()

protected PointerDeviceBase()

Fields

PointerState

protected PointerDeviceState PointerState

Field Value

PointerDeviceState

Properties

DownPointers

The index of the pointers that are down

public IReadOnlySet<PointerPoint> DownPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

Id

The unique identifier of this device

public abstract Guid Id { get; }

Property Value

Guid

Name

The name of the device

public abstract string Name { get; }

Property Value

string

PressedPointers

The index of the pointers that have been pressed since the last frame

public IReadOnlySet<PointerPoint> PressedPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

Priority

The device priority. Larger means higher priority when selecting the first device of some type

public int Priority { get; set; }

Property Value

int

ReleasedPointers

The index of the pointers that have been released since the last frame

public IReadOnlySet<PointerPoint> ReleasedPointers { get; }

Property Value

IReadOnlySet<PointerPoint>

Source

The input source the device belongs to.

public abstract IInputSource Source { get; }

Property Value

IInputSource

SurfaceAspectRatio

The aspect ratio of the touch surface area

public float SurfaceAspectRatio { get; }

Property Value

float

SurfaceSize

The size of the surface used by the pointer, for a mouse this is the size of the window, for a touch device, the size of the touch area, etc.

public Vector2 SurfaceSize { get; }

Property Value

Vector2

Methods

Normalize(Vector2)

protected Vector2 Normalize(Vector2 position)

Parameters

position Vector2

Returns

Vector2

SetSurfaceSize(Vector2)

Calls SetSurfaceSize(Vector2) and invokes the SurfaceSizeChanged event

protected void SetSurfaceSize(Vector2 newSize)

Parameters

newSize Vector2

New size of the surface

Update(List<InputEvent>)

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

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

Events

SurfaceSizeChanged

Raised when the surface size of this pointer changed

public event EventHandler<SurfaceSizeChangedEventArgs> SurfaceSizeChanged

Event Type

EventHandler<SurfaceSizeChangedEventArgs>