Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Make WASD customizable #10

Closed
hellerve opened this issue Sep 5, 2017 · 6 comments
Closed

Make WASD customizable #10

hellerve opened this issue Sep 5, 2017 · 6 comments

Comments

@hellerve
Copy link
Owner

hellerve commented Sep 5, 2017

WASD is not ergonomic on some keyboard layouts, and it would be a good idea to create a simple way to change them. Currently, we do these movements in a switch statement, meaning we cannot have non-constants. It would make sense to make this scriptable through Lua, though.

Thanks to this comment on HN for making me aware of this issue.

@Kausta
Copy link

Kausta commented Sep 6, 2017

The switch part seems easy as it can be done with refactoring it to if cases. However, a config system is probably required to handle/take different keys and it would be also good in general to have configurable settings.

I could help, but the config type/file format should be discussed first.

@hellerve
Copy link
Owner Author

hellerve commented Sep 6, 2017

That’s not really a problem. The struct e_context already has a config option (the tab width), which is also settable through Lua. A simple way to refactor this then would be to put the keys into the e_context struct (or maybe even add a e_config struct) and then add Lua setters and getters.

@hellerve
Copy link
Owner Author

hellerve commented Sep 6, 2017

PR #17 should fix this. I’ll merge it within the next 24 hours if there are no objections.

@kianmeng
Copy link

kianmeng commented Sep 6, 2017

Does this means we can use hjkl for cursor movement after this PR?

@hellerve
Copy link
Owner Author

hellerve commented Sep 6, 2017

I’m afraid not, because h (hide) still takes precedence. I’ve thought about the precedence rules, and I firmly believe that having sensible defaults is more important than making it extremely customizable. Thus I’d rather talk about changing those if the need arises.

@hellerve
Copy link
Owner Author

hellerve commented Sep 7, 2017

PR was merged, I’ll close this for now.

@hellerve hellerve closed this as completed Sep 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants