Some keyboards won't send more than two keypresses if shift and enter
are a subset of the pressed keys :/.
Also moved the panic logic into the main event loop to avoid
interference from key logic.
e.g
alt = layer(A) -> alt = layer(alt)
Additionally, left hand modifier names are shorthand
for both associated keycodes as opposed to just
the left one.
e.g:
control = esc
is equivalent to:
leftcontrol = esc
rightcontrol = esc
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.
If an interposed key up event is detected after an overloaded key is
pressed the overloaded key up event is not interpreted as a tap. This is
especially noticeable in cases where the overloaded key is struck
quickly in succession. This patch modifies the behaviour so only an
interposed key down resolves the overloaded key in favour of its
associated layer.
- Disable echo to prevent noise when the terminal is focused.
- Properly distinguish between terminal input and stdout closure.
- Use \t as a delimiter to facilitate easier scripting. (#60)
- Immediately terminate on pipe closures (e.g keyd -m|head -n1).
- Include product/vendor ids.
- Ouptut to STDOUT by default.
The output shouldn't change (maybe, no promises) try to avoid relying on this.
This commit adds a swap action which allows the user to alter the
active layer mid-stroke.
E.G
meta = layer(meta)
[meta:M]
a = swap(tab, A-tab)
[tab:A]
a = A-tab
capslock = A-S-tab
causes the following sequence
<meta down> <a> <capslock>
to produce 'A-S-tab' after capslock instead of 'M-capslock'
since the tab layer is active for the duration of the
meta keypress after 'a' has been tapped.
This breaks the ability to assign a layer toggle of a given layer
within the layer itself.
E.G
meta = layer(meta)
[meta:M]
a = layert(meta)
No longer toggles the meta layer when meta+a is pressed since the
corresponding meta key up event clears the layer after it is set. Note
that this does not apply to oneshot keys. This configuration seems to be
rare enough to ignore but can be explicitly accounted for with
additional state if necessary.