blockly > ShortcutRegistry > KeyboardShortcut
ShortcutRegistry.KeyboardShortcut interface
Signature:
interface KeyboardShortcut
Properties
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `KeyboardShortcut` interface defines the structure for keyboard shortcuts within Blockly's ShortcutRegistry."],["Each `KeyboardShortcut` includes properties for its name, key codes, callback function, precondition function, collision behavior, and metadata."],["Properties like `callback`, `keyCodes`, `preconditionFn`, `allowCollision`, and `metadata` are optional, allowing for flexibility in shortcut definitions."],["The `callback` function executes when the shortcut is triggered, while `preconditionFn` determines if the shortcut is applicable in the current context."],["`allowCollision` dictates if multiple shortcuts with the same key codes can be registered, while `metadata` can store additional information about the shortcut."]]],[]]