[feature request] magic key/repeat key
hi, ive been using keyd for like 2 days now and ive got basically my whole qmk keyboard setup running all on my laptop keyboard which is pretty sick
that being said, from what i read, i do miss one feature from qmk and it would be cool if it could be implemented: the magic key/repeat/alternate repeat key
basically it repeats whatever letter was last typed, so 'dd' would become 'd[repeat]' you can also specify that after typing a letter, a different one shall be repeated, so 'ar' (which is hard for me to type on colemak) would become 'a[repeat]'
thank you :)
This sounds like a cool feature!
I do want to note that it is somewhat possible already with the oneshotm action. There will be a lot of duplication and drawbacks such as the loss of repeat-by-holding, which is why a dedicated feature would be nice, but still, if you're really missing it:
[main]
a = oneshotm(repeata, a)
b = oneshotm(repeatb, b)
# etcetera
[repeata]
. = a
[repeatb]
. = b
# etcetera
thank you for providing a way to do what i was looking for - will try this now, although as you said its kinda impractical to do for every key if you just want a normal repeat key
I would also love to have this feature
The problem with the workaround is that keyd can only handle a certain amount of layers. If I add to many that way this assertion fails and keyd crashes
This has been been implemented on master in the form of repeat(). It also works with compound sequences (C-x) and macros. Let me know how you get along with it.
But repeat would not allow to define a more general magic key, would it? Like a *mag* -> ab but c *mag* -> cd
Only a *mag* -> aa and c *mag* -> cc right? Or am I missing something?
Yes, repeat() will only repeat the last sequence. If you want a pair of keys to produce an arbitrary sequence then a layer is the appropriate tool, as mentioned by @nsbgn.
Yes, the problem is just that you quickly run out of layers with that method as I mentioned above and also that you can no longer hold the keys, which is sometimes useful (e.g. to undo all changes when holding u in vim). But the max number of layers can be increased quite easily when building from source. Thanks a lot for your awesome work ❤️
Actually one more question: Is it intended that when I bind a = oneshotm(repeata, a) as suggested above only one 'a' get printed when I hold the a key?
love this feature, but when doing sequences like xxyy there is an issue where pressing a new key while the repeat key is held does not update the register for subsequent presses of the repeat key, producing xxyx instead. This occurs in words like "coffee", "woollen", "bookkeeper", etc when typing at speed. If this is an intended behaviour, I'd love an additional command repeatd() which repeats the last keydown.
when doing sequences like xxyy there is an issue where pressing a new key while the repeat key is held does not update the register for subsequent presses of the repeat key, producing xxyx instead.
This is indeed a bug and should be fixed in the latest commit.
the problem is just that you quickly run out of layers
Most users aren't going to manually remap a large number of keys like this and, as you've observed the limit can be manually be tweaked if necessary.
and also that you can no longer hold the keys
This is now possible using overloadk() as proposed in #1095.
I'm tentatively closing this, but feel free to comment/reopen it if you encounter any issues.