sxhkd
sxhkd copied to clipboard
Support for Letter Chords?
For example, it would be possible to do something like this:
d + f
mpc toggle
To differentiate this from things like xcape and your keydouble, I call it a chord. You would not be able to hold d and then press f. You would have to press them at the same time (with a very small configurable timeout; maybe around 30 milliseconds by default) otherwise nothing would happen.
Is this a feature you would consider adding, or do you think that it is outside the scope of the program?
+1 for this one! I am also intrested in this feature.
This is an interesting idea.
Some implementation considerations / discussion points:
The name "chord" has a muddled meaning in keyboarding-related things. sxhkd
source and documentation take it to mean a combination of modifiers with a key (like ctrl + shift + r
). emacs
uses the same definition, except when it doesn't. vim
doesn't have a feature called that, but the vim-arpeggio
plugin does what you describe and calls them arpeggio key mappings, presumably to side-step just this naming issue.
I think calling them arpeggio mappings here would reduce confusion.
How should this work with modifier keys, if at all? We may need new syntax, since it's ambiguous whether ctrl + mod1 + s
is a mapping as we have them now or an arpeggio mapping as proposed here.
Does the order keys are pressed in matter? I'd find it hard to press a 4-key chord in a specific order. However, switching between virtual desktops using ,.
and .,
(note reversed order) would be really neat. Would these be separate features?
@anko Well I explained what I meant by "chord" if that's directed at my request. I use vim-arpeggio
, and that is the closest example to what I mean; however, I think using the term arpeggio would greatly increase confusion. vim-arpeggio
is named that because it also allows you type the keys in very rapid succession if you don't have a keyboard that has nkro (arpeggiated chord). A broken chord is exactly what I'm not talking about; sxhkd
already has that (prefix keys).
Maybe a better term could be used than chord and maybe a different symbol than +
should be used in the case that this feature was added.
With what I'm suggesting, the order would not matter, only that the time in between the presses be very small. I'm not sure how viable it would be for the user to consistently press keys that wouldn't be used as prefixes (letters, symbols, etc.) fast enough consecutively in a particular order so that the timeout could be set small enough where they wouldn't accidently trigger an action. I'll test with vim-arpeggio
maybe.
+1 for this, this is a great idea! I'm using a similar feature in emacs (called key-chord I believe) and it would be great to use it in sxkhd.
Any update on this?
Doesn't seem like it's a priority.