Home > SYS_ShortcutKey > registerShortcutKey
SYS_ShortcutKey.registerShortcutKey() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
注册快捷键
Signature
typescript
registerShortcutKey(shortcutKey: TShortcutKeys, title: string, callbackFn: (shortcutKey: TShortcutKeys) => void | Promise<void>, documentType: Array<ESYS_ShortcutKeyEffectiveEditorDocumentType> | undefined, scene: Array<ESYS_ShortcutKeyEffectiveEditorScene> | undefined, hotkeyCmd: string): Promise<boolean>;
1
Parameters
Parameter | Type | Description |
---|---|---|
shortcutKey | 快捷键,数组中包含多个元素则解析为组合快捷键,将按规则排序后存入缓存 | |
title | string | 快捷键标题,快捷键的友好名称 |
callbackFn | (shortcutKey: TShortcutKeys) => void | Promise<void> | 回调函数 |
documentType | Array<ESYS_ShortcutKeyEffectiveEditorDocumentType> | undefined | |
scene | Array<ESYS_ShortcutKeyEffectiveEditorScene> | undefined | |
hotkeyCmd | string |
Returns
Promise<boolean>
注册操作是否成功