libei  0.2
A library for Emulated Input
libei Documentation

This is the libei API reference.libei provides two different libraries, libei for clients that need to emulate input events and libeis for servers that manage those input events (read: compositors). A common setup looks like this:

+-----------------------+
physical devices - | libinput | compositor |
+----------+------------+
| libeis |
+------------+
||
||
+-------------+
| libei |
+-------------+
| application |
+-------------+

Notably, the process using libeis is in control of all input devices. A libei client can send events but it is up to the EIS implementation to process them.

The two libraries are independently and usually consumers of either libei or libeis should never need the other library.

EI - the client implementation

The libei library is the component used by clients that want to emulate input events. It provides the required methods to connect to an EIS implementation, query for input devices available to the client, and send input.

The API documentation for EI is available at EI - The client API.

EIS - the server implementation

The libeis library is the component used by processes that handle input events. It provides the required methods to set up seats and input devices, accept libei client connections, and receive input events from those clients.

The API documentation for EI is available at EIS - The server API.

Examples

Please see the demo programs in the git repository.

The eis-demo-client is a minimal client that connects to an EIS implementation and sends events.

The eis-demo-server is a minimal EIS implementation that accepts all requests and prints them to screen.

The eis-fake-portal is a minimal XDG Desktop Portal implementation that connects a portal-aware libei client with an EIS implementation.

Building against libei or libeis

libei and libeis provides pkg-config files. Software that uses libei or libeis should use pkg-config and the PKG_CHECK_MODULES autoconf macro or the dependency() function in meson.

Otherwise, the most rudimentary way to compile and link a program against libei or libeis is:

    gcc -o myprogram mylibeiclient.c `pkg-config --cflags --libs libei`
    gcc -o myprogram myEISimplementation.c `pkg-config --cflags --libs libeis`

For further information on using pkgconfig see the pkg-config documentation.

About

Documentation generated from git commit 8cff3cf