libinput
0.3.0
A wrapper library for input devices
|
Enumerations | |
enum | libinput_device_capability { LIBINPUT_DEVICE_CAP_KEYBOARD, LIBINPUT_DEVICE_CAP_POINTER, LIBINPUT_DEVICE_CAP_TOUCH } |
Capabilities on a device. More... | |
enum | libinput_keyboard_key_state { LIBINPUT_KEYBOARD_KEY_STATE_RELEASED, LIBINPUT_KEYBOARD_KEY_STATE_PRESSED } |
Logical state of a key. More... | |
enum | libinput_led { LIBINPUT_LED_NUM_LOCK, LIBINPUT_LED_CAPS_LOCK, LIBINPUT_LED_SCROLL_LOCK } |
Mask reflecting LEDs on a device. More... | |
enum | libinput_button_state { LIBINPUT_BUTTON_STATE_RELEASED, LIBINPUT_BUTTON_STATE_PRESSED } |
Logical state of a physical button. More... | |
enum | libinput_pointer_axis { LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL, LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL } |
Axes on a device that are not x or y coordinates. More... | |
Functions | |
void | libinput_device_ref (struct libinput_device *device) |
Increase the refcount of the input device. More... | |
void | libinput_device_unref (struct libinput_device *device) |
Decrease the refcount of the input device. More... | |
void | libinput_device_set_user_data (struct libinput_device *device, void *user_data) |
Set caller-specific data associated with this input device. More... | |
void * | libinput_device_get_user_data (struct libinput_device *device) |
Get the caller-specific data associated with this input device, if any. More... | |
const char * | libinput_device_get_sysname (struct libinput_device *device) |
Get the system name of the device. More... | |
const char * | libinput_device_get_output_name (struct libinput_device *device) |
A device may be mapped to a single output, or all available outputs. More... | |
struct libinput_seat * | libinput_device_get_seat (struct libinput_device *device) |
Get the seat associated with this input device. More... | |
void | libinput_device_led_update (struct libinput_device *device, enum libinput_led leds) |
Update the LEDs on the device, if any. More... | |
int | libinput_device_get_keys (struct libinput_device *device, char *keys, size_t size) |
Set the bitmask in keys to the bitmask of the keys present on the device (see linux/input.h), up to size characters. More... | |
void | libinput_device_calibrate (struct libinput_device *device, float calibration[6]) |
Apply the 3x3 transformation matrix to absolute device coordinates. More... | |
int | libinput_device_has_capability (struct libinput_device *device, enum libinput_device_capability capability) |
Check if the given device has the specified capability. More... | |
enum libinput_led |
void libinput_device_calibrate | ( | struct libinput_device * | device, |
float | calibration[6] | ||
) |
Apply the 3x3 transformation matrix to absolute device coordinates.
This matrix has no effect on relative events.
Given a 6-element array [a, b, c, d, e, f], the matrix is applied as
int libinput_device_get_keys | ( | struct libinput_device * | device, |
char * | keys, | ||
size_t | size | ||
) |
Set the bitmask in keys to the bitmask of the keys present on the device (see linux/input.h), up to size characters.
device | A current input device |
keys | An array filled with the bitmask for the keys |
size | Size of the keys array |
const char* libinput_device_get_output_name | ( | struct libinput_device * | device | ) |
A device may be mapped to a single output, or all available outputs.
If a device is mapped to a single output only, a relative device may not move beyond the boundaries of this output. An absolute device has its input coordinates mapped to the extents of this output.
struct libinput_seat* libinput_device_get_seat | ( | struct libinput_device * | device | ) |
Get the seat associated with this input device.
A seat can be uniquely identified by the physical and logical seat name. There will ever be only one seat instance with a given physical and logical seat name pair at any given time, but if no external reference is kept, it may be destroyed if no device belonging to it is left.
device | A previously obtained device |
const char* libinput_device_get_sysname | ( | struct libinput_device * | device | ) |
Get the system name of the device.
device | A previously obtained device |
void* libinput_device_get_user_data | ( | struct libinput_device * | device | ) |
Get the caller-specific data associated with this input device, if any.
device | A previously obtained device |
int libinput_device_has_capability | ( | struct libinput_device * | device, |
enum libinput_device_capability | capability | ||
) |
Check if the given device has the specified capability.
void libinput_device_led_update | ( | struct libinput_device * | device, |
enum libinput_led | leds | ||
) |
Update the LEDs on the device, if any.
If the device does not have LEDs, or does not have one or more of the LEDs given in the mask, this function does nothing.
device | A previously obtained device |
leds | A mask of the LEDs to set, or unset. |
void libinput_device_ref | ( | struct libinput_device * | device | ) |
Increase the refcount of the input device.
An input device will be freed whenever the refcount reaches 0. This may happen during dispatch if the device was removed from the system. A caller must ensure to reference the device correctly to avoid dangling pointers.
device | A previously obtained device |
void libinput_device_set_user_data | ( | struct libinput_device * | device, |
void * | user_data | ||
) |
Set caller-specific data associated with this input device.
libinput does not manage, look at, or modify this data. The caller must ensure the data is valid.
device | A previously obtained device |
user_data | Caller-specific data pointer |
void libinput_device_unref | ( | struct libinput_device * | device | ) |
Decrease the refcount of the input device.
An input device will be freed whenever the refcount reaches 0. This may happen during dispatch if the device was removed from the system. A caller must ensure to reference the device correctly to avoid dangling pointers.
device | A previously obtained device |