Skip to content
EN

Interface: InputState ​

Scene input state (docs/109 §5). Controllers read actions, never key codes.

Properties ​

PropertyModifierType
focusedreadonlyboolean

Methods ​

define() ​

ts
define(def): () => void;

Parameters ​

ParameterType
defInputActionDef

Returns ​

() => void


bind() ​

ts
bind(binding): () => void;

Parameters ​

ParameterType
bindingKeyBinding

Returns ​

() => void


held() ​

ts
held(action): boolean;

Parameters ​

ParameterType
actionstring

Returns ​

boolean


pressed() ​

ts
pressed(action): boolean;

Parameters ​

ParameterType
actionstring

Returns ​

boolean


released() ​

ts
released(action): boolean;

Parameters ​

ParameterType
actionstring

Returns ​

boolean


axis() ​

ts
axis(action): number;

Parameters ​

ParameterType
actionstring

Returns ​

number


setAction() ​

ts
setAction(action, value): void;

Programmatic device override; visible after the next beginFrame only.

Parameters ​

ParameterType
actionstring
valuenumber | boolean

Returns ​

void


press() ​

ts
press(action): void;

Forces a one-frame press edge at the next beginFrame.

Parameters ​

ParameterType
actionstring

Returns ​

void


release() ​

ts
release(action): void;

Forces a one-frame release edge at the next beginFrame.

Parameters ​

ParameterType
actionstring

Returns ​

void


clear() ​

ts
clear(): void;

Returns ​

void


focus() ​

ts
focus(): void;

Returns ​

void


blur() ​

ts
blur(): void;

Returns ​

void


setKey() ​

ts
setKey(code, down): void;

Device layer: set a physical key state; bindings map it to actions.

Parameters ​

ParameterType
codestring
downboolean

Returns ​

void


hasBinding() ​

ts
hasBinding(code): boolean;

Whether any binding uses code (keyboard preventDefault gate).

Parameters ​

ParameterType
codestring

Returns ​

boolean


pressKey() ​

ts
pressKey(code): void;

Forces one press edge for every action bound to code at the next beginFrame.

Parameters ​

ParameterType
codestring

Returns ​

void


beginFrame() ​

ts
beginFrame(): void;

Refreshes pressed/released/held snapshots; called before update.

Returns ​

void

Suity 开发者文档 · API 由 TypeDoc 从声明文件生成