It turns out the linux uinput driver is capable of
automatically generating repeat events if you
flip the right kernel bit, so we can eliminate
the kludgy thread based repeat logic.
This should also fix#397, since said code was relying
on undefined pthread behaviour that caused some systems
to busy wait.
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.
Make the device table globally accessible to avoid redundant bookkeeping in
daemon.c. The pointers held in the daemon device list were invalidated
by evloop code shifting the table around and causing a segfault.
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
...
Mostly plumbing.
Summary:
- Key processing logic remains untouched.
- Simplified IPC logic.
- Streamlined the event loop.
- Consolidated config and descriptor parsing logic into config.[ch].
- Eliminated internal KEYD_* environment variables in favour of compile time macros.
- Added color coding to the daemon output.
- Load all configuration files on initialization.
The last change increases initialization time (on the order of μs) and resident
memory size, but simplifies the config logic and has the benefit of linting all
files immediately while also allowing for the introduction of in-daemon
reloading. This ultimately results in a net saving for the user since
most service managers are horrendously slow :(.
It also means hotplugged devices will use the in-memory config set (which
probably makes more sense anyway) instead of dynamically scanning the config
directory. This is more efficient for small config directories (<100 files),
but less efficient for large ones (uncommon).