Skip to content

Interface: IInput ​

Methods ​

GetPointerX() ​

ts
GetPointerX(): number;

Returns ​

number


GetPointerY() ​

ts
GetPointerY(): number;

Returns ​

number


Init() ​

ts
Init(canvas): void;

Parameters ​

ParameterType
canvasHTMLCanvasElement

Returns ​

void


IsKeyDown() ​

ts
IsKeyDown(code): boolean;

Parameters ​

ParameterType
codestring

Returns ​

boolean


IsPointerDown() ​

ts
IsPointerDown(button?): boolean;

No argument: true if any button or touch is down.

Parameters ​

ParameterType
button?PointerButton

Returns ​

boolean


OnKeyDown() ​

ts
OnKeyDown(cb): InputUnsubscribe;

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


OnKeyUp() ​

ts
OnKeyUp(cb): InputUnsubscribe;

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


OnPointerDown() ​

ts
OnPointerDown(cb): InputUnsubscribe;

---------- Event subscriptions ---------- Each returns an unsubscribe fn. Fire order = registration order; no per-frame coalescing.

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


OnPointerMove() ​

ts
OnPointerMove(cb): InputUnsubscribe;

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


OnPointerUp() ​

ts
OnPointerUp(cb): InputUnsubscribe;

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


OnWheel() ​

ts
OnWheel(cb): InputUnsubscribe;

Parameters ​

ParameterType
cb(e) => void

Returns ​

InputUnsubscribe


Shutdown() ​

ts
Shutdown(): void;

Returns ​

void

© 2026 PlayAdGentic