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 bindings with the Super (Meta/Cmd/Win) modifier #6592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Apr 4, 2023

Terminals which support the enhanced keyboard protocol send events for keys pressed with the Super modifier (Windows/Linux key or the Command key). We can support keybindings with the Super modifier in Helix with a few small changes: mapping the event from crossterm and parsing/representing the modifier in the KeyEvent string representation.

The binding can be done with Meta-, Win- or Cmd- prefixes - these are all synonymous. For example keys.normal.Cmd-s = ":write".

Closes #2913
Closes #6582

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 4, 2023
helix-view/src/input.rs Outdated Show resolved Hide resolved
@koalalorenzo

This comment was marked as outdated.

Terminals which support the enhanced keyboard protocol send events for
keys pressed with the Super modifier (Windows/Linux key or the Command
key). The only changes that are needed to support this in Helix are:

* Mapping the modifier from crossterm's KeyModifiers to Helix's
  KeyModifiers.
* Representing and parsing the modifier from the KeyEvent text
  representation.
* Documenting the ability to remap it.

When writing keybindings, use 'Meta-', 'Cmd-' or 'Win-' which are all
synonymous. For example:

    [keys.normal]
    Cmd-s = ":write"

will trigger for the Windows or Linux keys and the Command key plus 's'.
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 6, 2024
@the-mikedavis the-mikedavis marked this pull request as ready for review July 6, 2024 14:51
@the-mikedavis the-mikedavis changed the title Support bindings with the Super modifier Support bindings with the Super (Meta/Cmd/Win) modifier Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
6 participants