-
Notifications
You must be signed in to change notification settings - Fork 142
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
feat: implemented an alt-repeat key #1392
base: main
Are you sure you want to change the base?
Conversation
This implementation only allows simple |
Thanks for the contribution! Could you comment on the advantages of this action over switch? |
I added a small section at the end of the |
It's more like - if the end goal is to implement magic sturdy, this PR could instead be a "tutorial" style document of using To minimize code bloat and maintenance burden, it is desirable to have fewer ways to solve a problem. To add more flavour and context, Kanata does have different ways to do things over time as it has grown, though each added item has been written to solve a previously unsolved use case. For example; there are 3 different chording solutions:
There were strong reasons why the multiple chording solutions all exist. Then there is The
Yea the sequences code paths aren't triggered by |
Hey ! Sorry for ghosting you for like two weeks, I got absolutely slammed by homework in uni. To be absolutely real with you, I didn’t know The advantages of
|
The backing types - and at a higher level, the backing concepts - of key history switch logic and macros are not trivially convertible. A macro has more capabilities than simply typing keys. I suppose only the mappable subset of macro can be "converted" to switch logic when used in that position. macro: Lines 13 to 32 in 80189bd
key history: kanata/keyberon/src/action/switch.rs Lines 76 to 90 in 80189bd
kanata/keyberon/src/action/switch.rs Lines 252 to 256 in 80189bd
You should consider whether Though, if you mean parsing the underlying key output order of arbitrary actions and mapping that to a key history, such that typing the same key history outside of using that action results in
This to me would be the most fruitful improvement to implement. I don't see any issues with adding more functionality in templates, and it could help in plenty of other actions outside of switch. I don't expect it would be too challenging to implement either. https://github.com/jtroo/kanata/blob/main/parser/src/cfg/deftemplate.rs#L45 |
Describe your changes. Use imperative present tense.
Implemented an
alt-repeat
key. It functions the same as the standardrepeat
key, but takes in a list of pairs of keycodes to give substitutions. For instance, you can repeat keys as usual, but sende
instead ofd
when repeating thed
key.A possible use-case for such a feature is to implement the "magic key" from Magic-Sturdy
Disclaimer : I am not a native English speaker, I am sorry if there are typos in the docs ^^'
Checklist