Skip to content

Kiln API / kiln / InputController

Interface: InputController ​

What app.input exposes. Implemented by the input plugin.

Methods ​

script() ​

ts
script(events): InputController;

Queues scripted input, relative to the current frame.

Parameters ​

ParameterType
eventsreadonly ScriptEvent[]

Returns ​

InputController


press() ​

ts
press(action): InputController;

Holds an action down from the next frame on.

Parameters ​

ParameterType
actionstring

Returns ​

InputController


release() ​

ts
release(action): InputController;

Parameters ​

ParameterType
actionstring

Returns ​

InputController


tap() ​

ts
tap(action): InputController;

Presses on the next frame and releases the frame after.

Parameters ​

ParameterType
actionstring

Returns ​

InputController


setAxis() ​

ts
setAxis(x, y): InputController;

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

InputController


clearAxis() ​

ts
clearAxis(): InputController;

Returns ​

InputController


reset() ​

ts
reset(): InputController;

Drops scripted state and pending events.

Returns ​

InputController


record() ​

ts
record(): object;

Starts recording what the game sees as a script: action values (press/release), the move axis when a stick or script drives it, and the pointer. stop() returns it (peek() copies it so far); script() replays it.

Returns ​

object

stop() ​
ts
stop(): ScriptEvent[];
Returns ​

ScriptEvent[]

peek() ​
ts
peek(): ScriptEvent[];
Returns ​

ScriptEvent[]