summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Morel <rolfmorel@gmail.com>2013-08-09 16:32:17 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-08-20 16:11:09 -0700
commitce55406ec246d9daa6cb2493bc7a48265ad4457e (patch)
treeccb15b698f69d129d311d002ae748331f220ce0b
parentb8e7c9a670ad22bce8e7798f5aa54f3d305e0832 (diff)
downloadweston-ce55406ec246d9daa6cb2493bc7a48265ad4457e.tar.gz
weston-ce55406ec246d9daa6cb2493bc7a48265ad4457e.tar.bz2
weston-ce55406ec246d9daa6cb2493bc7a48265ad4457e.zip
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.
-rw-r--r--src/evdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 3f1eb7ce..fccbaaac 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -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 */