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

Add ability to remap key bindings #39

Open
oreid-zd opened this issue Oct 21, 2024 · 3 comments
Open

Add ability to remap key bindings #39

oreid-zd opened this issue Oct 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@oreid-zd
Copy link

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

Thanks!

@lusingander
Copy link
Owner

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

Related: #25

@lusingander lusingander added the enhancement New feature or request label Oct 21, 2024
@oreid-zd
Copy link
Author

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

@lusingander
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants