Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / InputSourceReader

Interface: InputSourceReader ​

Defined in: input/actions.ts:18

What the action layer reads each frame. InputSystem supplies the real one.

Methods ​

isKeyHeld() ​

ts
isKeyHeld(code): boolean;

Defined in: input/actions.ts:20

A key held, by code or key, case-insensitive.

Parameters ​

ParameterType
codestring

Returns ​

boolean


isMouseHeld() ​

ts
isMouseHeld(button): boolean;

Defined in: input/actions.ts:21

Parameters ​

ParameterType
buttonnumber

Returns ​

boolean


mouseDelta() ​

ts
mouseDelta(): {
  x: number;
  y: number;
};

Defined in: input/actions.ts:23

Mouse movement this frame, in pixels.

Returns ​

ts
{
  x: number;
  y: number;
}
NameTypeDefined in
xnumberinput/actions.ts:23
ynumberinput/actions.ts:23

gamepads() ​

ts
gamepads(): GamepadSnapshot[];

Defined in: input/actions.ts:24

Returns ​

GamepadSnapshot[]


touchButton() ​

ts
touchButton(id): boolean;

Defined in: input/actions.ts:25

Parameters ​

ParameterType
idstring

Returns ​

boolean


touchAxis() ​

ts
touchAxis(id): {
  x: number;
  y: number;
};

Defined in: input/actions.ts:27

stick: -1..1 with y up. look: pixels this frame, y down.

Parameters ​

ParameterType
id"look" | "stick"

Returns ​

ts
{
  x: number;
  y: number;
}
NameTypeDefined in
xnumberinput/actions.ts:27
ynumberinput/actions.ts:27