overload() and timeout() rely on being able to store and execute descriptors
without tying them to specific key states. To achieve idempotence, oneshot()
currently neutralizes the upstroke of the activating key if the layer in
question is already active. This can yield an activation asymmetry in the rare
event that the oneshot descriptor is not associated with a physical key and is
activated while the associated layer is already active.
To fix this, we activate the layer for each oneshot depression and keep track
of the oneshot activation depth.
Switch to hungarian notation to distinguish between timeout and macro variants of
existing actions. The old names are kept for backward compatibility but will
eventually be removed.
toggle2 -> togglem
swap2 -> swapm
overload2 -> overloadt
overload3 -> overloadt2
oneshotm and layerm have also been added for completeness.
This patch attempts to minimize the number of extraneous modifier events. We
used to do this in v1, but impetuously abandoned the attempt in the name of
reducing code complexity.
We achieve this by strategically updating modifier state and internally
reintroducing key sequences as distinct (from macros) entities, which are tied
to the generating key down/up pair.
This will be transparent to most users, but should make the output sequences
easier to reason about and may help in certain edge cases (#184) or in the
case of software with buggy input systems (#181).
This is a major release which breaks backward compatibility for
non-trivial configs. (we are still in beta after all :P).
In the absence of too much blowback this will probably become the final
v2 design.
Much of this harkens back to the v1, with some additional simplifications
and enhancements.
See DESIGN.md for a more detailed account.
keyd redux take 1.
A rewrite which simplifies the config format and provides a
solid foundation for incrementally introducing experimental
features.
Internally:
- Modularized and rewrote most of the code
- Added a mini testing framework (t/)
Externally:
- Eliminated layer inheritance in favour of simple types.
(layouts are now defined with `:layout` instead of `:main`)
- Macros are now repeatable.
- Overload now accepts a hold threshold timeout.
- Config files are now vendor/product id oriented.
- SIGUSR1 now triggers a config reload.
- Modifiers are layers by default and can be extended directly.
- Config files now end in `.conf`.
- `layert()` is now `toggle()`.
- All layers are 'modifier layers' (terminological change)
- Eliminated the dedicated modifer layout.
- Modifiers no longer apply to key sequences defined within a layer.
(Layer sequences are now always executed verbatim.)
The old behaviour was unintuitive and can be emulated using nested
layers if necessary.