mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-05-09 05:58:16 +02:00
Add an API to get the repeat values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
965e2250a0
commit
eda87cdf91
2 changed files with 24 additions and 0 deletions
|
|
@ -963,3 +963,17 @@ libevdev_get_event_type_max(unsigned int type)
|
||||||
|
|
||||||
return ev_max[type];
|
return ev_max[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
libevdev_get_repeat(struct libevdev *dev, int *delay, int *period)
|
||||||
|
{
|
||||||
|
if (!libevdev_has_event_type(dev, EV_REP))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (delay != NULL)
|
||||||
|
*delay = dev->rep_values[REP_DELAY];
|
||||||
|
if (period != NULL)
|
||||||
|
*period = dev->rep_values[REP_PERIOD];
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -536,4 +536,14 @@ const char * libevdev_get_input_prop_name(unsigned int prop);
|
||||||
*/
|
*/
|
||||||
int libevdev_get_event_type_max(unsigned int type);
|
int libevdev_get_event_type_max(unsigned int type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the repeat delay and repeat period values for this device.
|
||||||
|
*
|
||||||
|
* @param delay If not null, set to the repeat delay value
|
||||||
|
* @param period If not null, set to the repeat period value
|
||||||
|
*
|
||||||
|
* @return 0 on success, -1 if this device does not have repeat settings.
|
||||||
|
*/
|
||||||
|
int libevdev_get_repeat(struct libevdev *dev, int *delay, int *period);
|
||||||
|
|
||||||
#endif /* libevdev_H */
|
#endif /* libevdev_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue