Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ShortcutKey): 增加快捷键配置能力 Closes #571 #832

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

ufec
Copy link
Collaborator

@ufec ufec commented Jul 6, 2024

现在你可以自定义hook的快捷键啦!

For User

点击设置按钮->点击快捷键配置即可,跟vscode一样,双击快捷键即可编辑

For Dev

先查看对应hook的快捷键,API为:cherry.toolbar.menus.hooks['header'].shortcutKeyMapheader 换成你的即可

API更新快捷键:cherry.toolbar.menus.hooks['header'].updateShortcutKeyMap(旧的快捷键, 新的快捷键)

注:旧的快捷键可以通过上面的API来获取,但新的API一定要按照旧的快捷键来,如果你不知道规则,请先查看 https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values,或者参考上面的编辑方法,观察 localStorage 的变化来实现

对了,如果你在一个页面需要打开多个 cherry,他们的快捷键配置互不影响

@tencent-adm
Copy link
Member

tencent-adm commented Jul 6, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Jul 7, 2024

【预览链接】

@ufec ufec merged commit ed5fa38 into Tencent:dev Jul 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants