Key capture script


I am doing a keystroke capture script.

Can anyone advice what the syntax should be to cancel the default action of a pressed key after I have captured the stroke?

I thought it might be preventDefault() but that doesnt seem to work.


I found in controllerExample.js the syntax to use…

Controller.keyPressEvent.connect(keyPressEvent); is used for our script to use the keystrokes,

Controller.captureKeyEvents({ text: “A” }); is used to stop certain text from flowing on to normal functions.

This is working for all alphabet keys except h and p they seem immune to controller capture, as does BACKSPACE.