研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >字段 >onShortcut
Field.onShortcut() 方法
处理指定的键盘快捷键。
Signature:
onShortcut(_shortcut: KeyboardShortcut): boolean;
参数
参数 |
类型 |
说明 |
_快捷方式 |
KeyboardShortcut |
要处理的快捷方式。 |
返回:
布尔值
如果快捷方式已处理,则为 true,否则为 false。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-11。
[null,null,["最后更新时间 (UTC):2024-10-11。"],[[["The `onShortcut` method in Blockly's Field class determines how a field responds to a specific keyboard shortcut."],["It takes a `KeyboardShortcut` object as input, representing the triggered shortcut."],["If the method successfully processes the shortcut, it returns `true`; otherwise, it returns `false`."]]],["The `onShortcut` method, part of the `Field` class, processes keyboard shortcuts. It accepts a `KeyboardShortcut` as input. The method's core function is to determine if a given shortcut is relevant to a particular field. It returns a boolean value: `true` if the shortcut was handled by the field, and `false` if the shortcut was not handled, implying that other parts of the program can potentially handle it.\n"]]