Skip to content

Add ability to remap key bindings #39

Closed

Description

@oreid-zd

Would be great to be able to remap key bindings via environment variables or something.

Thanks!

Activity

  1. lusingander commented on Oct 21, 2024

    @lusingander
    Owner

    Yes, I agree that this feature is important. I'd like to implement it, but I haven't started yet.

    Related: #25

  2. added
    enhancement
    on Oct 21, 2024
  3. oreid-zd commented on Oct 22, 2024

    @oreid-zd
    Author

    Thanks @lusingander! I haven't written much Rust but could give it a crack if you'd accept a PR?

  4. lusingander commented on Oct 22, 2024

    @lusingander
    Owner

    Thanks for showing interest in this project!

    I think it might help to take a look at the custom keybinding implementations from another TUI project of mine:

    Basically, I think the implementation should follow a similar approach. But there are a few things to keep in mind:

    • It should be possible to assign multiple keybindings to a single action.
    • It should also be possible to assign the same keybinding to multiple actions.
      • If keybindings overlap in the same view state, it’s okay as long as one is chosen internally.

    If you're planning to submit a PR, it might be a good idea to split it into two steps:

    • First, update the code to fetch fixed keybindings from variables.
    • Then, add support for loading custom keybindings from config.toml or keybindings.toml, so users can set their own.

    Feel free to reach out if you have any questions or need help along the way.

  5. linked a pull request that will close this issueCustom keybindings #54on Mar 9, 2025
  6. oreid-zd commented on Mar 12, 2025

    @oreid-zd
    Author

    Thanks legend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions