[PATCH weston] evdev: write EV_SYN input_event along with led events to device

Kristian Høgsberg hoegsberg at gmail.com
Mon Aug 12 22:23:55 PDT 2013


On Fri, Aug 09, 2013 at 04:32:17PM +0200, Rolf Morel wrote:
> 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.

That sounds reasonable, patch committed.

Kristian

> ---
>  src/evdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index 5ad4d6b..4d818be 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 */
> -- 
> 1.8.3.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list