libinput
0.1.0
A wrapper library for input devices
|
Typedefs | |
typedef void(* | libinput_log_handler )(enum libinput_log_priority priority, void *user_data, const char *format, va_list args) |
Log handler type for custom logging. More... | |
Functions | |
struct libinput * | libinput_udev_create_for_seat (const struct libinput_interface *interface, void *user_data, struct udev *udev, const char *seat_id) |
Create a new libinput context from udev, for input devices matching the given seat ID. More... | |
struct libinput * | libinput_path_create_context (const struct libinput_interface *interface, void *user_data) |
Create a new libinput context that requires the caller to manually add or remove devices with libinput_path_add_device() and libinput_path_remove_device(). More... | |
struct libinput_device * | libinput_path_add_device (struct libinput *libinput, const char *path) |
Add a device to a libinput context initialized with libinput_path_create_from_device(). More... | |
void | libinput_path_remove_device (struct libinput_device *device) |
Remove a device from a libinput context initialized with libinput_path_create_from_device() or added to such a context with libinput_path_add_device(). More... | |
int | libinput_get_fd (struct libinput *libinput) |
libinput keeps a single file descriptor for all events. More... | |
int | libinput_dispatch (struct libinput *libinput) |
Main event dispatchment function. More... | |
struct libinput_event * | libinput_get_event (struct libinput *libinput) |
Retrieve the next event from libinput's internal event queue. More... | |
enum libinput_event_type | libinput_next_event_type (struct libinput *libinput) |
Return the type of the next event in the internal queue. More... | |
void * | libinput_get_user_data (struct libinput *libinput) |
int | libinput_resume (struct libinput *libinput) |
Resume a suspended libinput context. More... | |
void | libinput_suspend (struct libinput *libinput) |
Suspend monitoring for new devices and close existing devices. More... | |
void | libinput_destroy (struct libinput *libinput) |
Destroy the libinput context. More... | |
void | libinput_log_set_priority (enum libinput_log_priority priority) |
Set the global log priority. More... | |
enum libinput_log_priority | libinput_log_get_priority (void) |
Get the global log priority. More... | |
void | libinput_log_set_handler (libinput_log_handler log_handler, void *user_data) |
Set the global log handler. More... | |
typedef void(* libinput_log_handler)(enum libinput_log_priority priority, void *user_data, const char *format, va_list args) |
Log handler type for custom logging.
priority | The priority of the current message |
user_data | Caller-specific data pointer as previously passed into libinput_log_set_handler() |
format | Message format in printf-style |
args | Message arguments |
enum libinput_event_type |
Event type for events returned by libinput_get_event().
Enumerator | |
---|---|
LIBINPUT_EVENT_NONE |
This is not a real event type, and is only used to tell the user that no new event is available in the queue. |
LIBINPUT_EVENT_DEVICE_ADDED |
Signals that a device has been added to the context. The device will not be read until the next time the user calls libinput_dispatch() and data is available. This allows setting up initial device configuration before any events are created. |
LIBINPUT_EVENT_DEVICE_REMOVED |
Signals that a device has been removed. No more events from the associated device will be in the queue or be queued after this event. |
LIBINPUT_EVENT_KEYBOARD_KEY | |
LIBINPUT_EVENT_POINTER_MOTION | |
LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE | |
LIBINPUT_EVENT_POINTER_BUTTON | |
LIBINPUT_EVENT_POINTER_AXIS | |
LIBINPUT_EVENT_TOUCH_DOWN | |
LIBINPUT_EVENT_TOUCH_UP | |
LIBINPUT_EVENT_TOUCH_MOTION | |
LIBINPUT_EVENT_TOUCH_CANCEL | |
LIBINPUT_EVENT_TOUCH_FRAME |
Signals the end of a set of touchpoints at one device sample time. This event has no coordinate information attached. |
void libinput_destroy | ( | struct libinput * | libinput) |
Destroy the libinput context.
After this, object references associated with the destroyed context are invalid and may not be interacted with.
libinput | A previously initialized libinput context |
int libinput_dispatch | ( | struct libinput * | libinput) |
Main event dispatchment function.
Reads events of the file descriptors and processes them internally. Use libinput_get_event() to retrieve the events.
Dispatching does not necessarily queue libinput events.
libinput | A previously initialized libinput context |
struct libinput_event* libinput_get_event | ( | struct libinput * | libinput) |
Retrieve the next event from libinput's internal event queue.
After handling the retrieved event, the caller must destroy it using libinput_event_destroy().
libinput | A previously initialized libinput context |
int libinput_get_fd | ( | struct libinput * | libinput) |
libinput keeps a single file descriptor for all events.
Call into libinput_dispatch() if any events become available on this fd.
void* libinput_get_user_data | ( | struct libinput * | libinput) |
libinput | A previously initialized libinput context |
enum libinput_log_priority libinput_log_get_priority | ( | void | ) |
Get the global log priority.
Messages with priorities equal to or higher than the argument will be printed to the current log handler.
The default log priority is LIBINPUT_LOG_PRIORITY_ERROR.
void libinput_log_set_handler | ( | libinput_log_handler | log_handler, |
void * | user_data | ||
) |
Set the global log handler.
Messages with priorities equal to or higher than the current log priority will be passed to the given log handler.
The default log handler prints to stderr.
log_handler | The log handler for library messages. |
user_data | Caller-specific data pointer, passed into the log handler. |
void libinput_log_set_priority | ( | enum libinput_log_priority | priority) |
Set the global log priority.
Messages with priorities equal to or higher than the argument will be printed to the current log handler.
The default log priority is LIBINPUT_LOG_PRIORITY_ERROR.
priority | The minimum priority of log messages to print. |
enum libinput_event_type libinput_next_event_type | ( | struct libinput * | libinput) |
Return the type of the next event in the internal queue.
This function does not pop the event off the queue and the next call to libinput_get_event() returns that event.
libinput | A previously initialized libinput context |
struct libinput_device* libinput_path_add_device | ( | struct libinput * | libinput, |
const char * | path | ||
) |
Add a device to a libinput context initialized with libinput_path_create_from_device().
If successful, the device will be added to the internal list and re-opened on libinput_resume(). The device can be removed with libinput_path_remove_device().
If the device was successfully initialized, it is returned in the device argument. The lifetime of the returned device pointer is limited until the next linput_dispatch(), use libinput_device_ref() to keep a permanent reference.
libinput | A previously initialized libinput context |
path | Path to an input device |
struct libinput* libinput_path_create_context | ( | const struct libinput_interface * | interface, |
void * | user_data | ||
) |
Create a new libinput context that requires the caller to manually add or remove devices with libinput_path_add_device() and libinput_path_remove_device().
The context is fully initialized but will not generate events until at least one device has been added.
interface | The callback interface |
user_data | Caller-specific data passed to the various callback interfaces. |
void libinput_path_remove_device | ( | struct libinput_device * | device) |
Remove a device from a libinput context initialized with libinput_path_create_from_device() or added to such a context with libinput_path_add_device().
Events already processed from this input device are kept in the queue, the LIBINPUT_EVENT_DEVICE_REMOVED event marks the end of events for this device.
If no matching device exists, this function does nothing.
device | A libinput device |
int libinput_resume | ( | struct libinput * | libinput) |
Resume a suspended libinput context.
This re-enables device monitoring and adds existing devices.
libinput | A previously initialized libinput context |
void libinput_suspend | ( | struct libinput * | libinput) |
Suspend monitoring for new devices and close existing devices.
This all but terminates libinput but does keep the context valid to be resumed with libinput_resume().
libinput | A previously initialized libinput context |
struct libinput* libinput_udev_create_for_seat | ( | const struct libinput_interface * | interface, |
void * | user_data, | ||
struct udev * | udev, | ||
const char * | seat_id | ||
) |
Create a new libinput context from udev, for input devices matching the given seat ID.
New devices or devices removed will appear as events during libinput_dispatch.
interface | The callback interface |
user_data | Caller-specific data passed to the various callback interfaces. |
udev | An already initialized udev context |
seat_id | A seat identifier. This string must not be NULL. |