Draft: Add libkorb for receiving input events
Sits on top of !47 (merged), this is just the first draft of the API:
This adds another component to libei - libkorb [1]
The goal of libkorb is to connect to an EIS server and set up triggers that allow a client to receive input from the EIS server.
There's a large overlap between libei and libkorb but sufficient difference to warrant this as a separate library. For the EIS side it's easier to integrate and conceptually there is more overlap too.
The basic functionality is:
- libkorb connects to an EIS implementation and binds to one of the seats, EIS sends a set of devices.
- libkorb sets up sinks for input events. Those sinks comprise of devices to be captured and triggers for when they should be captured.
- the EIS implementation decides when the trigger conditions are met, and forwards the events to the korb client.
Example
Synergy/Barrier would connect to a compositor as korb client. The compositor sends a seat with a pointer and keyboard device, together with a set of regions for the pointer device representing the screen layout.
synergy then sets up an edge trigger on one of the regions with a sink containing both the pointer and keyboard device.
When the real pointer moves across that edge, the compositor starts sending relative input events to synergy instead of processing it as usual. synergy converts those relative events into the position across all screen and forwards them to the applicable remote synergy instance where the event is replayed as absolute event through libei.
Since the compositor is in control of events, it can stop that at any time or filter events that it does not want forwarded. Otherwise, the client can stop the trigger and thus signal that it no longer wants to receive events.
cc @jadahl, @ofourdan, @emersion
[1] initially called libeier, but that made the API really hard to read (for me anyway)