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

Choose how you handle multiple bindings for the same shortcut #98

Open
Grasscropper opened this issue Nov 26, 2020 · 1 comment
Open
Assignees
Labels
enhancement feature feature request

Comments

@Grasscropper
Copy link

Grasscropper commented Nov 26, 2020

First of all, great library! Sababa ;) ! I changed from another one I was using and I'm glad I did, so thanks for that.

So I my suggestion is that you can set the way you handle multiple bindings for the same shortcut. I basically see it as handling it in the following 3 ways when the shortcut is used:

1. Trigger all of the commands/bindings
2. Trigger the first one added
3. Trigger the last one added

Let me explain my usecase. I have a card component (kind of like a popup) that can be closed with escape. It is possible for multiple cards to be opened in a stack on top of eachother. In my usecase I would want to use option 3 because I want the last opened card to be closed with escape. Then when that is closed I want escape to close the next card and so on.

So yeah that's the suggestion, let me know what you think.

p.s. A slightly separate issue/wish I have is that the closeKey shortcut does not get "occupied" when the help menu is not open. I find it natural for it to be the escape key but I also want to use escape elsewhere in the app.

Toda raba!

@omridevk
Copy link
Owner

@Grasscropper
Very happy to hear your feedback and that you love the library :)

  1. I have a branch to add support for multiple bindings for the same key, but I have some issues on making it work with Debounce and since I don't want to break the existing API, until I find a way to make it work with debounce and multiple binding, I don't want to release it.
  2. Would you mind opening a new issue for that and i'll try to handle it, currently , not sure that I will be able to as until I add support for the feature you requested, this won't be possible (if you already have shortcut assigned to escape).
    I'll try to think of a way to handle it.

@omridevk omridevk added enhancement feature feature request labels May 13, 2022
@omridevk omridevk self-assigned this May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature feature request
Projects
None yet
Development

No branches or pull requests

2 participants