Functions for printing or querying event ranges.
More...
Functions for printing or querying event ranges.
The list of names is compiled into libevdev and will not change when the kernel changes. Adding or removing names requires a re-compilation of libevdev. Likewise, the max for each event type is compiled in and does not check the underlying kernel.
const char* libevdev_event_code_get_name |
( |
unsigned int |
type, |
|
|
unsigned int |
code |
|
) |
| |
- Parameters
-
type | The event type for the code to query (EV_SYN, EV_REL, etc.) |
code | The event code to return the name for (e.g. ABS_X) |
- Returns
- The name of the given event code (e.g. ABS_X) or NULL for an invalid type or code
- Note
- The list of names is compiled into libevdev. If the kernel adds new defines for new properties libevdev will not automatically pick these up.
int libevdev_event_is_code |
( |
const struct input_event * |
ev, |
|
|
unsigned int |
type, |
|
|
unsigned int |
code |
|
) |
| |
Helper function to check if an event is of a specific type and code.
This is virtually the same as:
ev->type == type && ev->code == code
with the exception that some sanity checks are performed to ensure type and code are valid.
- Note
- The ranges for types and codes are compiled into libevdev. If the kernel changes the max value, libevdev will not automatically pick these up.
- Parameters
-
ev | The input event to check |
type | Input event type to compare the event against (EV_REL, EV_ABS, etc.) |
code | Input event code to compare the event against (ABS_X, REL_X, etc.) |
- Returns
- 1 if the event type matches the given type and code, 0 otherwise (or if type/code are invalid)
int libevdev_event_is_type |
( |
const struct input_event * |
ev, |
|
|
unsigned int |
type |
|
) |
| |
Helper function to check if an event is of a specific type.
This is virtually the same as:
ev->type == type
with the exception that some sanity checks are performed to ensure type is valid.
- Note
- The ranges for types are compiled into libevdev. If the kernel changes the max value, libevdev will not automatically pick these up.
- Parameters
-
ev | The input event to check |
type | Input event type to compare the event against (EV_REL, EV_ABS, etc.) |
- Returns
- 1 if the event type matches the given type, 0 otherwise (or if type is invalid)
int libevdev_event_type_get_max |
( |
unsigned int |
type | ) |
|
- Parameters
-
type | The event type to return the maximum for (EV_ABS, EV_REL, etc.). No max is defined for EV_SYN. |
- Returns
- The max value defined for the given event type, e.g. ABS_MAX for a type of EV_ABS, or -1 for an invalid type.
- Note
- The max value is compiled into libevdev. If the kernel changes the max value, libevdev will not automatically pick these up.
const char* libevdev_event_type_get_name |
( |
unsigned int |
type | ) |
|
- Parameters
-
type | The event type to return the name for. |
- Returns
- The name of the given event type (e.g. EV_ABS) or NULL for an invalid type
- Note
- The list of names is compiled into libevdev. If the kernel adds new defines for new properties libevdev will not automatically pick these up.
const char* libevdev_property_get_name |
( |
unsigned int |
prop | ) |
|
- Parameters
-
prop | The input prop to return the name for (e.g. INPUT_PROP_BUTTONPAD) |
- Returns
- The name of the given input prop (e.g. INPUT_PROP_BUTTONPAD) or NULL for an invalid property
- Note
- The list of names is compiled into libevdev. If the kernel adds new defines for new properties libevdev will not automatically pick these up.
-
On older kernels input properties may not be defined and libevdev_property_get_name() will always return NULL