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

Support multiple keys for bindings #504

Open
gabriellanata opened this issue Jan 10, 2025 · 3 comments · May be fixed by #505
Open

Support multiple keys for bindings #504

gabriellanata opened this issue Jan 10, 2025 · 3 comments · May be fixed by #505

Comments

@gabriellanata
Copy link

Is your feature request related to a problem? Please describe.
I would like to assign multiple keys to an action, but it is currently only possible to assign a single key. Any additional keybindings replace the previous one.

For example, i want both tab and right arrow to go to the next section. However, this doesnt work and only the second key will work:

keybindings:
  universal:
    - key: right
      builtin: nextSection
    - key: tab
      builtin: nextSection

Describe the solution you'd like
I'd like support for multiple keys. The key binding descriptions already include multiple keys by showing them separated by "/". So i propose using the same syntax for adding multiple keys.

keybindings:
  universal:
    - key: right/tab
      builtin: nextSection

Describe alternatives you've considered
Al alternative is to make the original snippet work and having multiple keys be defined separately. This is a perfectly fine alternative.

@gabriellanata gabriellanata linked a pull request Jan 10, 2025 that will close this issue
@gabriellanata
Copy link
Author

Proposed solution is here: #505

@Omnikron13
Copy link
Contributor

In YAML lists should be represented like this:

keybindings:
   universal:
    - key: [right, tab]
      builtin: nextSection

And then when the YAML is parsed you need to process either the single value or list accordingly.

@gabriellanata
Copy link
Author

Thanks for the feedback, I updated the PR

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 a pull request may close this issue.

2 participants