uinput: use named initializers for the event struct

With the 64 bit timestamps, the struct layout changes into a flatter
version, so let's use the input_event_(u)sec helpers to transparently
handle this.

Fixes #25

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-07-05 14:02:23 +10:00
parent 0c7e1d2f67
commit c9781f00f3

View file

@ -468,7 +468,13 @@ libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev,
unsigned int code,
int value)
{
struct input_event ev = { {0,0}, type, code, value };
struct input_event ev = {
.input_event_sec = 0,
.input_event_usec = 0,
.type = type,
.code = code,
.value = value
};
int fd = libevdev_uinput_get_fd(uinput_dev);
int rc, max;