Skip to content

textmode.js / Textmodifier / isKeyPressed

Method: isKeyPressed() ​

ts
isKeyPressed(key): boolean;

Check whether a key is currently pressed.

Parameters ​

ParameterTypeDescription
keystringThe key to check (e.g., 'a', 'Enter', 'ArrowLeft')

Returns ​

boolean

true when the key is currently pressed.

Example ​