libevdev
0.3
A wrapper library for evdev devices
|
Modifying the set of events reported by this device. More...
Functions | |
void | libevdev_set_name (struct libevdev *dev, const char *name) |
void | libevdev_set_phys (struct libevdev *dev, const char *phys) |
void | libevdev_set_uniq (struct libevdev *dev, const char *uniq) |
void | libevdev_set_id_product (struct libevdev *dev, int product_id) |
void | libevdev_set_id_vendor (struct libevdev *dev, int vendor_id) |
void | libevdev_set_id_bustype (struct libevdev *dev, int bustype) |
void | libevdev_set_id_version (struct libevdev *dev, int version) |
int | libevdev_enable_property (struct libevdev *dev, unsigned int prop) |
void | libevdev_set_abs_minimum (struct libevdev *dev, unsigned int code, int min) |
Change the minimum for the given EV_ABS event code, if the code exists. More... | |
void | libevdev_set_abs_maximum (struct libevdev *dev, unsigned int code, int max) |
Change the maximum for the given EV_ABS event code, if the code exists. More... | |
void | libevdev_set_abs_fuzz (struct libevdev *dev, unsigned int code, int fuzz) |
Change the fuzz for the given EV_ABS event code, if the code exists. More... | |
void | libevdev_set_abs_flat (struct libevdev *dev, unsigned int code, int flat) |
Change the flat for the given EV_ABS event code, if the code exists. More... | |
void | libevdev_set_abs_resolution (struct libevdev *dev, unsigned int code, int resolution) |
Change the resolution for the given EV_ABS event code, if the code exists. More... | |
void | libevdev_set_abs_info (struct libevdev *dev, unsigned int code, const struct input_absinfo *abs) |
Change the abs info for the given EV_ABS event code, if the code exists. More... | |
int | libevdev_enable_event_type (struct libevdev *dev, unsigned int type) |
Forcibly enable an event type on this device, even if the underlying device does not support it. More... | |
int | libevdev_disable_event_type (struct libevdev *dev, unsigned int type) |
Forcibly disable an event type on this device, even if the underlying device provides it, effectively muting all keys or axes. More... | |
int | libevdev_enable_event_code (struct libevdev *dev, unsigned int type, unsigned int code, const void *data) |
Forcibly enable an event type on this device, even if the underlying device does not support it. More... | |
int | libevdev_disable_event_code (struct libevdev *dev, unsigned int type, unsigned int code) |
Forcibly disable an event code on this device, even if the underlying device provides it, effectively muting this key or axis. More... | |
int | libevdev_kernel_set_abs_value (struct libevdev *dev, unsigned int code, const struct input_absinfo *abs) |
Set the device's EV_ABS axis to the value defined in the abs parameter. More... | |
Modifying the set of events reported by this device.
By default, the libevdev device mirrors the kernel device, enabling only those bits exported by the kernel. This set of functions enable or disable bits as seen from the caller.
Enabling an event type or code does not affect event reporting - a software-enabled event will not be generated by the physical hardware. Disabling an event will prevent libevdev from routing such events to the caller. Enabling and disabling event types and codes is at the library level and thus only affects the caller.
If an event type or code is enabled at kernel-level, future users of this device will see this event enabled. Currently there is no option of disabling an event type or code at kernel-level.
int libevdev_disable_event_code | ( | struct libevdev * | dev, |
unsigned int | type, | ||
unsigned int | code | ||
) |
Forcibly disable an event code on this device, even if the underlying device provides it, effectively muting this key or axis.
libevdev will filter any events matching this type and code and none will reach the caller. libevdev_has_event_code() will return false for this code combination.
Disabling all event codes for a given type will not disable the event type. Use libevdev_disable_event_type() for that.
This is a local modification only affecting only this representation of this device.
Disabling EV_SYN will not work. Don't shoot yourself in the foot. It hurts.
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type to disable (EV_ABS, EV_KEY, ...) |
code | The event code to disable (ABS_X, REL_X, etc.) |
int libevdev_disable_event_type | ( | struct libevdev * | dev, |
unsigned int | type | ||
) |
Forcibly disable an event type on this device, even if the underlying device provides it, effectively muting all keys or axes.
libevdev will filter any events matching this type and none will reach the caller. libevdev_has_event_type() will return false for this type.
In most cases, a caller likely only wants to disable a single code, not the whole type. Use libevdev_disable_event_code() for that.
Disabling EV_SYN will not work. Don't shoot yourself in the foot. It hurts.
This is a local modification only affecting only this representation of this device.
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type to disable (EV_ABS, EV_KEY, ...) |
int libevdev_enable_event_code | ( | struct libevdev * | dev, |
unsigned int | type, | ||
unsigned int | code, | ||
const void * | data | ||
) |
Forcibly enable an event type on this device, even if the underlying device does not support it.
While this cannot make the device actually report such events, it will now return true for libevdev_has_event_code().
The last argument depends on the type and code:
This function calls libevdev_enable_event_type() if necessary.
This is a local modification only affecting only this representation of this device.
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type to enable (EV_ABS, EV_KEY, ...) |
code | The event code to enable (ABS_X, REL_X, etc.) |
data | If type is EV_ABS, data points to a struct input_absinfo. If type is EV_REP, data points to an integer. Otherwise, data must be NULL. |
int libevdev_enable_event_type | ( | struct libevdev * | dev, |
unsigned int | type | ||
) |
Forcibly enable an event type on this device, even if the underlying device does not support it.
While this cannot make the device actually report such events, it will now return true for libevdev_has_event_type().
This is a local modification only affecting only this representation of this device.
dev | The evdev device, already initialized with libevdev_set_fd() |
type | The event type to enable (EV_ABS, EV_KEY, ...) |
int libevdev_enable_property | ( | struct libevdev * | dev, |
unsigned int | prop | ||
) |
dev | The evdev device |
prop | The input property to enable, one of INPUT_PROP_... |
int libevdev_kernel_set_abs_value | ( | struct libevdev * | dev, |
unsigned int | code, | ||
const struct input_absinfo * | abs | ||
) |
Set the device's EV_ABS axis to the value defined in the abs parameter.
This will be written to the kernel.
dev | The evdev device, already initialized with libevdev_set_fd() |
code | The EV_ABS event code to modify, one of ABS_X, ABS_Y, etc. |
abs | Axis info to set the kernel axis to |
void libevdev_set_abs_flat | ( | struct libevdev * | dev, |
unsigned int | code, | ||
int | flat | ||
) |
Change the flat for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_abs_fuzz | ( | struct libevdev * | dev, |
unsigned int | code, | ||
int | fuzz | ||
) |
Change the fuzz for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_abs_info | ( | struct libevdev * | dev, |
unsigned int | code, | ||
const struct input_absinfo * | abs | ||
) |
Change the abs info for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_abs_maximum | ( | struct libevdev * | dev, |
unsigned int | code, | ||
int | max | ||
) |
Change the maximum for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_abs_minimum | ( | struct libevdev * | dev, |
unsigned int | code, | ||
int | min | ||
) |
Change the minimum for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_abs_resolution | ( | struct libevdev * | dev, |
unsigned int | code, | ||
int | resolution | ||
) |
Change the resolution for the given EV_ABS event code, if the code exists.
This function has no effect if libevdev_has_event_code() returns false for this code.
void libevdev_set_id_bustype | ( | struct libevdev * | dev, |
int | bustype | ||
) |
dev | The evdev device |
bustype | The bustype to assign to this device |
void libevdev_set_id_product | ( | struct libevdev * | dev, |
int | product_id | ||
) |
dev | The evdev device |
product_id | The product ID to assign to this device |
void libevdev_set_id_vendor | ( | struct libevdev * | dev, |
int | vendor_id | ||
) |
dev | The evdev device |
vendor_id | The vendor ID to assign to this device |
void libevdev_set_id_version | ( | struct libevdev * | dev, |
int | version | ||
) |
dev | The evdev device |
version | The version to assign to this device |
void libevdev_set_name | ( | struct libevdev * | dev, |
const char * | name | ||
) |
dev | The evdev device |
name | The new, non-NULL, name to assign to this device. |
void libevdev_set_phys | ( | struct libevdev * | dev, |
const char * | phys | ||
) |
dev | The evdev device |
phys | The new, non-NULL, phys to assign to this device. |
void libevdev_set_uniq | ( | struct libevdev * | dev, |
const char * | uniq | ||
) |
dev | The evdev device |
uniq | The new, non-NULL, uniq to assign to this device. |