mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 18:30:07 +01:00
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:
parent
0c7e1d2f67
commit
c9781f00f3
1 changed files with 7 additions and 1 deletions
|
|
@ -468,7 +468,13 @@ libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev,
|
||||||
unsigned int code,
|
unsigned int code,
|
||||||
int value)
|
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 fd = libevdev_uinput_get_fd(uinput_dev);
|
||||||
int rc, max;
|
int rc, max;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue