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.
Parts of the X input stack (e.g xinput) don't seem to use udev
attributes for keyboard detection and treat anything capable of
generating EV_REL as a pointer. To prevent issues with software that
relies on this behaviour (warpd) we create a dedicated pointer device
for pointer events.
Pressing an overloaded key while the layer it is bound to is active
causes permanent activation since it is first cleared by the overloaded
key up event and then subsequently reset by the layer key up event.
In most cases the user is unlikely to have multiple keys corresponding
to the same layer active at the same time, however in the case of
overloaded keys it is sometimes desirable to combine the keycodes to
which they are bound with the same modifier layer to which they are also
bound.
To achieve this we toggle on the overload key down/up rather than
explicitly set the layer to achieve the desired effect in the unusual
case where it is combined with another activation key for the same
layer. This is the same technique we use for layer + layert combos
acting on the same layer.
Some keyboards come with a builtin mouse, presently we ignore such
devices altogether. This patch adds support for some of these by passing
EV_REL events through the uinput device unmodified.
It is worth noting that certain touchpads will generate EV_ABS
events which require the device to define the size of
the input area and are consequently unsupported. Fortunately
it seems that most of these devices register as separate input
devices and are ignored by keyd. If this becomes an issue
it may make sense to revisit creating a 1-1 mapping between virtual
and physical devices but this seems unnecessary at present.