Table of Contents

Class DeviceCaptureState

Namespace
Stride.Input
Assembly
Stride.Input.dll

The capture state of one input device: which owner holds the device or its pointers, and whether reads of the device by scripts and systems are masked.

public sealed class DeviceCaptureState
Inheritance
object
DeviceCaptureState
Extension Methods

Remarks

Only InputManager changes this state, through its capture methods.

Constructors

DeviceCaptureState()

public DeviceCaptureState()

Properties

IsCaptured

Gets a value indicating whether an owner holds the whole device.

public bool IsCaptured { get; }

Property Value

bool

IsMasked

Gets a value indicating whether reads of the device by scripts and systems report no input.

public bool IsMasked { get; }

Property Value

bool

Owner

Gets the owner that holds the whole device, or null when the device is not captured.

public object Owner { get; }

Property Value

object

Priority

Gets the priority the current owner captured the device with.

public int Priority { get; }

Property Value

int

Methods

GetPointerOwner(int)

Gets the owner that holds a pointer of this device, or null when the pointer is not captured.

public object GetPointerOwner(int pointerId)

Parameters

pointerId int

The pointer identifier.

Returns

object

IsPointerMasked(int)

Gets a value indicating whether reads of a pointer by scripts and systems report no input, because the pointer or the whole device is captured.

public bool IsPointerMasked(int pointerId)

Parameters

pointerId int

The pointer identifier.

Returns

bool

TrackButtons<T>(IReadOnlySet<T>, IReadOnlySet<T>, IReadOnlySet<T>, IReadOnlySet<T>)

Creates a tracker that presents a device's down, pressed and released sets with this capture state applied.

public ButtonCaptureTracker<T> TrackButtons<T>(IReadOnlySet<T> down, IReadOnlySet<T> pressed, IReadOnlySet<T> released, IReadOnlySet<T> newPresses = null)

Parameters

down IReadOnlySet<T>

The input that is down.

pressed IReadOnlySet<T>

The input pressed this frame.

released IReadOnlySet<T>

The input released this frame.

newPresses IReadOnlySet<T>

The input newly pressed this frame, excluding repeats. Defaults to pressed for devices that do not repeat.

Returns

ButtonCaptureTracker<T>

The tracker, which follows this capture state for the lifetime of the device.

Type Parameters

T

The key or button type.

Remarks

The device must expose the tracker's Down, Pressed and Released sets as its own. The shared query methods, such as IsKeyDown, then read the device's sets as they are, so a device that exposes its raw sets instead would show captured input.