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

Keybind configuration #362

Open
Xithrius opened this issue May 3, 2023 · 17 comments
Open

Keybind configuration #362

Xithrius opened this issue May 3, 2023 · 17 comments
Assignees

Comments

@Xithrius
Copy link
Owner

Xithrius commented May 3, 2023

Some users may want different things, so let customization be a thing.

@Xithrius Xithrius added type: enhancement New feature or request area: keybinds Improvements or additions to keybinds labels May 3, 2023
@marcoradocchia
Copy link

I'm working on this!

@Xithrius
Copy link
Owner Author

Thank you!

@Xithrius
Copy link
Owner Author

Keybinds and CLI args have been updated, you might want to rebase.

@marcoradocchia
Copy link

Sure, I'll do. Thanks for the warning. I've been a little busy, but I'm slowly working on it. I'll update you soon on the progress.

@Xithrius Xithrius removed type: enhancement New feature or request area: keybinds Improvements or additions to keybinds labels Aug 3, 2023
@Xithrius
Copy link
Owner Author

Hey @marcoradocchia, would you still like to work on this?

@marcoradocchia
Copy link

marcoradocchia commented Oct 30, 2023

Hey @Xithrius ! I'm sorry to not have produced a PR yet. I have made progress, but it still does need some work. Would still like to contribute though, if you want me to. I might have some time tonight to work on it and update you on the status.

@Xithrius
Copy link
Owner Author

I have no problem with you working on this. I hope updating your branch from 100 commits behind wasn't too difficult.

@marcoradocchia
Copy link

It's fine, I'm working on it right now.
I was thinking about providing the user three TOML tables, one for each mode, like the following:

[keybind.normal]
# Normal keybinds...

[keybind.insert]
# Insert keybinds...

[keybind.dashboard]
# Dashboard keybinds...

What do you think about it?
Also, is there any requirement for the configuration format? Should it be a + separated a string containing key modifiers and a single keycode, maybe like "ALT + CTRL + p", or something else? I would like your opinion about this :)

@Xithrius
Copy link
Owner Author

Yeah, I think those tables will work. We can always change them in the future, of course. Along with that, I don't see a problem with the + separated keybinds.

@marcoradocchia
Copy link

marcoradocchia commented Nov 4, 2023

I have a keybind module, it does serialize/deserialize keybinds to/from TOML.
I've been writing some unit tests for it and they pass. It all seems to work as expected.
The three keybind.normal, keybind.insert and keybind.dashboard tables are now also available for keybind configuration.

I'm going ahead and work on integration now :)

P.S.: Keybind defaults match the currently hardcoded ones.

@marcoradocchia
Copy link

Still working on it... I'm sorry for the waiting, in this period I should have more time.

@Xithrius
Copy link
Owner Author

No problem! Thank you for the continued updates.

@marcoradocchia
Copy link

I'm now trying to update the help widget to dynamically display the configured keybinds. One important question about it: do you have any plans about implementing hot reloading of the configuration file?

@Xithrius
Copy link
Owner Author

I don't have any plans at the moment to do so.

@marcoradocchia
Copy link

May the user be able to configure multiple keybinds for the same action?
For reference, see:

Key::Ctrl('f') | Key::Right => {
self.input.move_forward(1);
}

@Xithrius
Copy link
Owner Author

Yes

@marcoradocchia
Copy link

Nice, thanks

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

No branches or pull requests

2 participants