mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 14:40:07 +01:00
Add function to get max value for a given ev type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
03fa066aec
commit
6019083a1a
2 changed files with 18 additions and 0 deletions
|
|
@ -929,3 +929,12 @@ libevdev_get_input_prop_name(unsigned int prop)
|
|||
|
||||
return input_prop_map[prop];
|
||||
}
|
||||
|
||||
int
|
||||
libevdev_get_event_type_max(unsigned int type)
|
||||
{
|
||||
if (type > EV_MAX)
|
||||
return -1;
|
||||
|
||||
return ev_max[type];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -527,4 +527,13 @@ const char * libevdev_get_event_code_name(unsigned int type, unsigned int code);
|
|||
*/
|
||||
const char * libevdev_get_input_prop_name(unsigned int prop);
|
||||
|
||||
/**
|
||||
* @return 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.
|
||||
*/
|
||||
int libevdev_get_event_type_max(unsigned int type);
|
||||
|
||||
#endif /* libevdev_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue