@fogrexon/glyph-arena-actions

Action bindings from keyboard codes. See also package README.

Exports

Generated from the package's source when the docs are built — do not edit this table by hand.

NameKind
ActionQuerytype
Actionstype
createActionsfunction

createActions()

const actions = createActions();

actions.bind("jump", ["Space"]);
actions.unbind("jump");

const query = actions.tick(keys); // Iterable<string> of KeyboardEvent.code values
query.down("jump");
query.pressed("jump");
query.released("jump");

actions.dispose();

Methods

ActionQuery

Per-tick snapshot for bound actions only.

MethodDescription
down(action)true when any bound code is in keys this tick
pressed(action)true when down is true this tick and was false last tick
released(action)true when down is false this tick and was true last tick

Unknown or unbound actions return false for all queries.

Edge behavior