ui.root.setKeyHandler

Sets a keydown event handler to the root panel with a non-predefined key. The handler is fired only once when a user presses the bound key command. The same key will be bound to the latest handler set to it.

UsageReturns
ui.root.setKeyHandler(keyCode, handler, description)
ArgumentTypeDetails
keyCodeList

A key code or an array of key codes. For example, ui.Key.A or [ui.Key.SHIFT, ui.Key.A].

handlerFunction

The handler for the key command.

descriptionString, optional

A short description that explains this key command. The description will be visible in the Shortcuts Menu.

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!