mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 23:10:07 +01:00
evdev: write EV_SYN input_event along with led events to device
Other clients of an evdev device need to have the events they receive be separated, in moment in time, from other events by an EV_SYN/ SYN_REPORT. This is the responsibility of the client who writes events into the stream.
This commit is contained in:
parent
3a65d85ad0
commit
5a49ec0e83
1 changed files with 3 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ evdev_led_update(struct evdev_device *device, enum weston_led leds)
|
|||
{ LED_CAPS_LOCK, LED_CAPSL },
|
||||
{ LED_SCROLL_LOCK, LED_SCROLLL },
|
||||
};
|
||||
struct input_event ev[ARRAY_LENGTH(map)];
|
||||
struct input_event ev[ARRAY_LENGTH(map) + 1];
|
||||
unsigned int i;
|
||||
|
||||
if (!device->caps & EVDEV_KEYBOARD)
|
||||
|
|
@ -57,6 +57,8 @@ evdev_led_update(struct evdev_device *device, enum weston_led leds)
|
|||
ev[i].code = map[i].evdev;
|
||||
ev[i].value = !!(leds & map[i].weston);
|
||||
}
|
||||
ev[i].type = EV_SYN;
|
||||
ev[i].code = SYN_REPORT;
|
||||
|
||||
i = write(device->fd, ev, sizeof ev);
|
||||
(void)i; /* no, we really don't care about the return value */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue