A KeyEvent is triggered when the user uses the keyboard (for example, click or release
a key). The targetBox of a KeyEvent is the focused box of the scene when there is no
open pop-up. If there is an open pop-up and that pop-up's "showNoActivate" attribute is not
"ignoreInput", the pop-up's current child.
Note: When there is no current child, then the pop-up itself, is the targetBox of the KeyEvent. A KeyEvent will bubble up the DOM.
KeyEvent types include:
- keyPress - Fired when a key is pressed, regardless of the
previous key state, so you will receive multiple keyPress when you keep the key down
for a while.
- keyUp - Fired when a key is up.
- keyDown - Fired when a key is down, only if the previous key state is
up.
- close - Fired when a scene is closed. You can inspect the virtualKeyCode, alt, ctrl,
and shift properties on the object to determine if the window was closed using
the keyboard. For example: Alt-F4, if you stop the propagation of this
event the window will not close.