Skip to content

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.

C#
public sealed class HeadlessInput : IInputSource

Inheritance

object ← HeadlessInput

Implements

IInputSource

Constructors

HeadlessInput()

C#
public HeadlessInput()

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; set; }

Property Value

bool

PadStyle

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

C#
public GamepadStyle PadStyle { get; set; }

Property Value

GamepadStyle

Pointer

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

C#
public PointerState Pointer { get; set; }

Property Value

PointerState

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

Set(Key, bool)

Presses or releases a key.

C#
public void Set(Key key, bool down)

Parameters

key Key

down bool

Set(PadButton, bool)

Presses or releases a gamepad button.

C#
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).

C#
public void Set(PadAxis axis, float value)

Parameters

axis PadAxis

value float

SetLeftStick(Vector2)

Sets both axes of the left stick.

C#
public void SetLeftStick(Vector2 value)

Parameters

value Vector2