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

scope 可以继承吗 #496

Open
ElvisWangTech opened this issue Oct 23, 2024 · 1 comment
Open

scope 可以继承吗 #496

ElvisWangTech opened this issue Oct 23, 2024 · 1 comment

Comments

@ElvisWangTech
Copy link

不同的场景只有个别键行为不一样,其余的都一样,能否实现多个scope继承同一个scope,或者有什么别的思路可以实现?

@msimic
Copy link

msimic commented Nov 17, 2024

you could wrap the hotkeys.setScope with your own function at startup and decide which other hotkeys need to be registered in that scope.

let originalSetScope = hotkeys.setScope.bind(hotkeys)
hotkeys.setScope = function(scope) {
   originalSetScope(scope)
   registerYourOwnShortcuts(scope)
}

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

No branches or pull requests

2 participants