Skip to content

KernelAPI reference

Class CompositeInput

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time

Several input sources read as one: a key or button is down when any source has it down; the stick or axis with the largest deflection wins.

C#
public sealed class CompositeInput : IInputSource

Inheritance

object ← CompositeInput

Implements

IInputSource

Constructors

CompositeInput(IReadOnlyList<IInputSource>)

Several input sources read as one: a key or button is down when any source has it down; the stick or axis with the largest deflection wins.

C#
public CompositeInput(IReadOnlyList<IInputSource> sources)

Parameters

sources IReadOnlyList<IInputSource>

Properties

LeftStick

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

C#
public Vector2 LeftStick { get; }

Property Value

Vector2

PadConnected

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

C#
public bool PadConnected { get; }

Property Value

bool

PadStyle

The style of the first source with a connected gamepad.

C#
public GamepadStyle PadStyle { get; }

Property Value

GamepadStyle

Pointer

The pointer of the first source whose pointer is present.

C#
public PointerState Pointer { get; }

Property Value

PointerState

Sources

The sources read, in order.

C#
public IReadOnlyList<IInputSource> Sources { get; }

Property Value

IReadOnlyList<IInputSource>

Methods

GetPadAxis(PadAxis)

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

C#
public float GetPadAxis(PadAxis axis)

Parameters

axis PadAxis

Returns

float

IsKeyDown(Key)

Whether key is held.

C#
public bool IsKeyDown(Key key)

Parameters

key Key

Returns

bool

IsPadDown(PadButton)

Whether button is held on the gamepad.

C#
public bool IsPadDown(PadButton button)

Parameters

button PadButton

Returns

bool