KernelAPI reference
Class HeadlessInput
Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time
Keys, a gamepad and a pointer that tests set by hand.
public sealed class HeadlessInput : IInputSourceInheritance
Implements
Constructors
HeadlessInput()
public HeadlessInput()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; set; }Property Value
PadStyle
The family of the connected gamepad, for button names in prompts; sources that cannot tell keep Xbox.
public GamepadStyle PadStyle { get; set; }Property Value
Pointer
The mouse over the virtual canvas; sources without one keep the default (not present).
public PointerState Pointer { get; set; }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
Returns
Set(Key, bool)
Presses or releases a key.
public void Set(Key key, bool down)Parameters
key Key
down bool
Set(PadButton, bool)
Presses or releases a gamepad button.
public void Set(PadButton button, bool down)Parameters
button PadButton
down bool
Set(PadAxis, float)
Sets a gamepad axis (sticks -1..1, triggers 0..1).
public void Set(PadAxis axis, float value)Parameters
axis PadAxis
value float
SetLeftStick(Vector2)
Sets both axes of the left stick.
public void SetLeftStick(Vector2 value)Parameters
value Vector2