-
Notifications
You must be signed in to change notification settings - Fork 36
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
Create a Keybinding service #1428
Comments
Although I've created this issue now, it won't be assigned a milestone since we're not planning to implement ourselves, and will instead wait for @janhancic to donate us an implementation instead; thanks @janhancic 👍. |
An action with an existing binding can be added anytime in the app's life. Would that mean that a binding that worked now stopped working, because another action was added with the same default binding? That doesn't sound right. |
After talking with @dchambers we decided that a blade would not provide the keybinding, it would be up to the app to do that. // in a blade
keybindingService.registerAction(actionId, actionDescription, actionCb);
// in the app
keybindingService.bindAction(actionId, shortcutKey);
keybindingService.removeBinding(actionId); |
@janhancic has identified the need for a service that allows blades to register actions that users might want to run using a key-combination. For example:
Apps are free to override the default key-binding suggested by a blade (assuming a default has been provided), like so:
Blades can ensure that their actions have unique identifiers by prefixing any action ids with the blade's namespace. If multiple blades attempt to set the same default key-binding then none of the actions inherit the default, and the app is required to explicitly bind these actions.
The text was updated successfully, but these errors were encountered: