Sometimes it is desirable to transition directly from one
toggled layer to another.
This commit extends swap() to work not just with keys bound to layer(),
but also toggle() and oneshot(). For swaps which occur one layer
deep (the anticipated use case), this is rougly equivalent of a
clear() followed by toggle(<target>).
This seems to be a common point of confusion for new users who don't
understand keyd's modifier semantics. Instead of allowing 'leftshift'
and company to be directly assigned and wreak havoc with properly
bound modifier keys, we now just transparently make modifier keys like
leftshift equivalent to their corresponding layers.
This is technically a breaking change since it makes improperly
bound keys subject to reassignments in the default modifier layer,
but one could argue this was undefined (and rare)
behaviour anyway. A warning is also now issued to ward the
user in the right direction.
Simplify the modifier table and reuse config parsing logic to simplify
config initialization. This comes with a small performance
penalty when parsing configs (~50 us), but makes things much
tidier.
The following change in udev seems to incorrectly identify the virtual
pointer as a 'tablet pad'.
https://github.com/systemd/systemd/commit/0855ce6772#diff-e3c18b2fc4f50acbb9f2d66a1daf229fde99a5c8785f17aa6f69e6a9c41ae2c7R261
This patch removes the BTN_[0-9] capability from the virtual pointer (which is
presently unused) to avoid the issue. It is unclear if this behaviour should
be considered pathological in udev, since I can't find any documentation which
suggests it is illegitimate for non tablet devices to make use of these codes.
Swap now applies exclusively to keys associated with the layer in which the
swap binding is contained. The corresponding swap target is now computed from
layer data associated with each depressed key instead of using the
most recent key which activated a layer. This makes the action more
consistent with the documented behaviour.
Disabling specific keys is likely to be something people will want to do,
however, the documentation doesn't emphasize that functionality. Add an example
about disabling keys with the 'noop' keyword to the documentation to make it
easier for users to figure out how to do that.
Closes#359
Eager layer activation seems to be more desirable for non time-based
overloading. In addition to facilitating modifier clicking for non-managed
mice, it appears some applications (E.g i3) care about isolated modifier down
events.