blockly > ShortcutRegistry > onKeyDown
ShortcutRegistry.onKeyDown() method
Handles key down events.
Signature:
onKeyDown(workspace: WorkspaceSvg, e: KeyboardEvent): boolean;
Parameters
Parameter |
Type |
Description |
workspace |
WorkspaceSvg |
The main workspace where the event was captured. |
e |
KeyboardEvent |
The key down event. |
Returns:
boolean
True if the event was handled, false otherwise.
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 `onKeyDown` method within the `ShortcutRegistry` class manages the 'key down' events in Blockly workspaces."],["It takes the workspace and the key down event as input, determining if a shortcut is triggered."],["The method returns `true` if the event was successfully handled by a registered shortcut, otherwise `false`."]]],[]]