Home > SYS_ShortcutKey > getShortcutKeys
SYS_ShortcutKey.getShortcutKeys() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
警告:此 API 现已弃用。
since EDA v4.2
查询快捷键列表
签名
typescript
function getShortcutKeys(
includeSystem?: boolean,
): Promise<
Array<{
shortcutKey: TSYS_ShortcutKeys;
title: string;
documentType: ESYS_ShortcutKeyEffectiveEditorRange[];
scene: ESYS_ShortcutKeyEffectiveEditorScene[];
}>
>;1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
参数名
参数 | 类型 | 描述 |
|---|---|---|
includeSystem | boolean | (可选) 是否包含系统快捷键 |
返回值
Promise<Array<{ shortcutKey: TSYS_ShortcutKeys; title: string; documentType: ESYS_ShortcutKeyEffectiveEditorRange[]; scene: ESYS_ShortcutKeyEffectiveEditorScene[] }>>
快捷键列表
示例
javascript
// 1. 只查非系统快捷键(扩展注册的),列表精简便于观察
const custom = await eda.sys_ShortcutKey.getShortcutKeys();
console.log('非系统快捷键数量:', custom.length);
// 2. 连同系统快捷键一起查(用于完整键位冲突检测)
const all = await eda.sys_ShortcutKey.getShortcutKeys(true);
console.log('含系统快捷键总数:', all.length);
// 3. 观察单条数据结构:shortcutKey 是键位数组,title 是名称,
// documentType 是生效页面,scene 是生效场景
const sample = all[0];
console.log('首条快捷键:', JSON.stringify(sample));1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12