onKeyPressRepeat(k: Key | Key[] , action: (k: Key )=>void ): KEventController

Register an event that runs when user presses certain keys (also fires repeatedly when the keys are being held down).

paramk- The key(s) to listen for.

paramaction- The function to run when the event is triggered.

// delete last character when "backspace" is being pressed and held
onKeyPressRepeat("backspace", () => {
    input.text = input.text.substring(0, input.text.length - 1);
});

returnsThe event controller.

sincev3000.1

groupInput

subgroupKeyboard

onKeyPressRepeat(action: (k: Key )=>void ): KEventController

Register an event that runs when user presses any key and fires repeatedly when the keys are being held down.

paramaction- The function to run when the event is triggered.

// delete last character when "backspace" is being pressed and held
onKeyPressRepeat((key) => {
    debug.log(`key ${key} is being repeatedly pressed`);
});

returnsThe event controller.

sincev3000.1

groupInput

subgroupKeyboard

onKeyPressRepeat(k: Key | Key[] , action: (k: Key )=>void ): KEventController

Register an event that runs when user presses certain keys (also fires repeatedly when the keys are being held down).

paramk- The key(s) to listen for.

paramaction- The function to run when the event is triggered.

// delete last character when "backspace" is being pressed and held
onKeyPressRepeat("backspace", () => {
    input.text = input.text.substring(0, input.text.length - 1);
});

returnsThe event controller.

sincev3000.1

groupInput

subgroupKeyboard

onKeyPressRepeat(action: (k: Key )=>void ): KEventController