This patch expands the semantics of timeout() to cover the case in which it is
used as a tap target. This facilitates a number of novel use cases, like
discriminating between single/double tap or implementing per-key oneshot
timeouts.
Specifically timeout() is now defined in terms of arbitrary key events rather
than the behaviour of the key to which it is bound (if any). The new definition
executes the second action if no key events occur before the timeout expires.
The implication of this is that when timeout() is executed as the result of a
tap action, action2 will be executed after the timeout expires unless another
key is struck in the interval. Note that this is backward compatible with the
old definition, since a key up event (i.e a tap) will result in a resolution to
the first action if timeout() is directly bound to a key.
For Example:
tab = overload(control, timeout(a, 100, b))
will presently produce no effect when 'tab' is tapped. Under the expanded
definition, tapping tab will produce 'b' if 100 milliseconds elapse without an
interceding key event.
A common problem is that users will have devices which split their functionality
between several device nodes (e.g laptop keyboards). It is often desirable to
only remap a subset of these device nodes so that some of them can operate
unintercepted by keyd (e.g touchpads) or be assigned to a different config.
This patch moves away from vendor/product id pairs by introducing unique identifiers.
To maintain backward compatibility, prefix matching is used and the old identifiers
are valid substrings of the new ones.
As a byproduct of this, a new bug/feature is born. <vendor id> in
isolation will now also match any device with the given vendor id.
Woe betide the user that makes use of this.
There is presently no way to revert to the 'default' (no) layout.
This patch makes setlayout(main) functionally equivalent to clearing
the applied layout (if present).
Add support for Gnome 45, which breaks backward extension
compatibility. We now ship and maintain two extensions :/.
The main change in Gnome seems to be the switch from a custom
import implementation to 'standard' ES6 style imports.
The init method also seems to have inexplicably
been swapped out in favour of extending a magic
class.
This patch takes the opportunity to clean up some residual cruft
and move the extension code out of the mapper script.
Specifically:
- Ship distinct extensions for Gnome 42-44 and Gnome 45 in /usr/local/share/keyd
- Move the named pipe to XDG_RUNTIME_DIR
- Initialize the pipe inside the extension instead of the script
to avoid potential race conditions during initialization.
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>).
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
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 reduces the compose sequence size by making use of keysyms a-z.
This is mainly done to improve support for programs with broken XCompose logic
(i.e chrome). A consequence of this is that the user will need to be using
the standard US layout on their display server to make use of unicode support.
Add a new listen command which prints layer state changes in real time. This
makes it possible to write things like custom visual indicators.
E.G
$ keyd listen
Sample output:
+shift
-shift
+layer
-layer
...
Swtich from
<name> = <key>
to
<key> = <name>
and confine keys to a single alias. This is arguably more intuitive
and reduces both config and implementation complexity.