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.
public sealed class CompositeInput : IInputSourceInheritance
Implements
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.
public CompositeInput(IReadOnlyList<IInputSource> sources)Parameters
sources IReadOnlyList<IInputSource>
Properties
LeftStick
Left stick, each axis in -1..1.
public Vector2 LeftStick { get; }Property Value
PadConnected
Whether a gamepad is connected. Sources without gamepads keep the default.
public bool PadConnected { get; }Property Value
PadStyle
The style of the first source with a connected gamepad.
public GamepadStyle PadStyle { get; }Property Value
Pointer
The pointer of the first source whose pointer is present.
public PointerState Pointer { get; }Property Value
Sources
The sources read, in order.
public IReadOnlyList<IInputSource> Sources { get; }Property Value
Methods
GetPadAxis(PadAxis)
Any gamepad axis. Sources that only know the left stick keep the default.
public float GetPadAxis(PadAxis axis)Parameters
axis PadAxis
Returns
IsKeyDown(Key)
Whether key is held.
public bool IsKeyDown(Key key)Parameters
key Key
Returns
IsPadDown(PadButton)
Whether button is held on the gamepad.
public bool IsPadDown(PadButton button)Parameters
button PadButton