Skip to content

InputAPI reference

Interface IInputSource

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

The raw device state a backend reports once per polled frame.

C#
public interface IInputSource

Remarks

Engine backends deliver events instead (IInputBackend); a polled source is still read every frame and its changes become the same events, so a host’s extra source or a test’s hand-set input is one more device.

Properties

LeftStick

Left stick, each axis in -1..1.

C#
Vector2 LeftStick { get; }

Property Value

Vector2

PadConnected

Whether a gamepad is connected. Sources without gamepads keep the default.

C#
bool PadConnected { get; }

Property Value

bool

PadStyle

The family of the connected gamepad, for button names in prompts; sources that cannot tell keep Xbox.

C#
GamepadStyle PadStyle { get; }

Property Value

GamepadStyle

Pointer

The mouse over the virtual canvas; sources without one keep the default (not present).

C#
PointerState Pointer { get; }

Property Value

PointerState

Pointers

Every pointer: the mouse while over the window, each finger or pen on the screen. Sources without pointers keep the default (none).

C#
IReadOnlyList<PointerInfo> Pointers { get; }

Property Value

IReadOnlyList<PointerInfo>

Methods

GetPadAxis(PadAxis)

Any gamepad axis. Sources that only know the left stick keep the default.

C#
float GetPadAxis(PadAxis axis)

Parameters

axis PadAxis

Returns

float

IsKeyDown(Key)

Whether key is held.

C#
bool IsKeyDown(Key key)

Parameters

key Key

Returns

bool

IsPadDown(PadButton)

Whether button is held on the gamepad.

C#
bool IsPadDown(PadButton button)

Parameters

button PadButton

Returns

bool