Skip to content

InputAPI reference

Struct DeviceId

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.dll
Guide: Input

Identifies one input device for as long as it is connected: a keyboard, a mouse, a touch screen, one gamepad. Ids are chosen by whoever reports the device (a backend’s own ids are positive; the engine’s polled sources and touch screen use negative ones) and are never reused while the game runs.

C#
public readonly struct DeviceId : IEquatable<DeviceId>

Implements

IEquatable<DeviceId>

Constructors

DeviceId(int)

Identifies one input device for as long as it is connected: a keyboard, a mouse, a touch screen, one gamepad. Ids are chosen by whoever reports the device (a backend’s own ids are positive; the engine’s polled sources and touch screen use negative ones) and are never reused while the game runs.

C#
public DeviceId(int Value)

Parameters

Value int

The id; 0 is None.

Properties

None

No device (scripted actions, sources that are not devices).

C#
public static DeviceId None { get; }

Property Value

DeviceId

TouchScreen

The touch screen the platform offers (its fingers become pointers of this device).

C#
public static DeviceId TouchScreen { get; }

Property Value

DeviceId

Value

The id; 0 is None.

C#
public int Value { get; init; }

Property Value

int

Methods

Deconstruct(out int)

C#
public void Deconstruct(out int Value)

Parameters

Value int

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(DeviceId)

C#
public bool Equals(DeviceId other)

Parameters

other DeviceId

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(DeviceId, DeviceId)

C#
public static bool operator ==(DeviceId left, DeviceId right)

Parameters

left DeviceId

right DeviceId

Returns

bool

operator !=(DeviceId, DeviceId)

C#
public static bool operator !=(DeviceId left, DeviceId right)

Parameters

left DeviceId

right DeviceId

Returns

bool