[PATCH libinput] evdev: ignore tablet pad devices explicitly

Hans de Goede hdegoede at redhat.com
Thu Feb 26 01:01:34 PST 2015


Hi,

On 26-02-15 07:02, Peter Hutterer wrote:
> We don't have real support for them yet but they have the ID_INPUT_TABLET tag
> set. Ignore them explicitly before someone thinks they're already working.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> ---
>   src/evdev.c | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/src/evdev.c b/src/evdev.c
> index bbc3dce..3956115 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -58,6 +58,7 @@ enum evdev_device_udev_tags {
>           EVDEV_UDEV_TAG_TABLET = (1 << 5),
>           EVDEV_UDEV_TAG_JOYSTICK = (1 << 6),
>           EVDEV_UDEV_TAG_ACCELEROMETER = (1 << 7),
> +        EVDEV_UDEV_TAG_BUTTONSET = (1 << 8),
>   };
>
>   struct evdev_udev_tag_match {
> @@ -73,6 +74,7 @@ static const struct evdev_udev_tag_match evdev_udev_tag_matches[] = {
>   	{"ID_INPUT_TOUCHPAD",		EVDEV_UDEV_TAG_TOUCHPAD},
>   	{"ID_INPUT_TOUCHSCREEN",	EVDEV_UDEV_TAG_TOUCHSCREEN},
>   	{"ID_INPUT_TABLET",		EVDEV_UDEV_TAG_TABLET},
> +	{"ID_INPUT_TABLET_PAD",		EVDEV_UDEV_TAG_BUTTONSET},
>   	{"ID_INPUT_JOYSTICK",		EVDEV_UDEV_TAG_JOYSTICK},
>   	{"ID_INPUT_ACCELEROMETER",	EVDEV_UDEV_TAG_ACCELEROMETER},
>
> @@ -1400,7 +1402,7 @@ evdev_configure_device(struct evdev_device *device)
>   	}
>
>   	log_info(libinput,
> -		 "input device '%s', %s is tagged by udev as:%s%s%s%s%s%s%s\n",
> +		 "input device '%s', %s is tagged by udev as:%s%s%s%s%s%s%s%s\n",
>   		 device->devname, devnode,
>   		 udev_tags & EVDEV_UDEV_TAG_KEYBOARD ? " Keyboard" : "",
>   		 udev_tags & EVDEV_UDEV_TAG_MOUSE ? " Mouse" : "",
> @@ -1408,7 +1410,8 @@ evdev_configure_device(struct evdev_device *device)
>   		 udev_tags & EVDEV_UDEV_TAG_TOUCHSCREEN ? " Touchscreen" : "",
>   		 udev_tags & EVDEV_UDEV_TAG_TABLET ? " Tablet" : "",
>   		 udev_tags & EVDEV_UDEV_TAG_JOYSTICK ? " Joystick" : "",
> -		 udev_tags & EVDEV_UDEV_TAG_ACCELEROMETER ? " Accelerometer" : "");
> +		 udev_tags & EVDEV_UDEV_TAG_ACCELEROMETER ? " Accelerometer" : "",
> +		 udev_tags & EVDEV_UDEV_TAG_BUTTONSET ? " Buttonset" : "");
>
>   	/* libwacom *adds* TABLET, TOUCHPAD but leaves JOYSTICK in place, so
>   	   make sure we only ignore real joystick devices */
> @@ -1419,6 +1422,14 @@ evdev_configure_device(struct evdev_device *device)
>   		return -1;
>   	}
>
> +	/* libwacom assigns tablet _and_ tablet_pad to the pad devices */
> +	if (udev_tags & EVDEV_UDEV_TAG_BUTTONSET) {
> +		log_info(libinput,
> +			 "input device '%s', %s is a buttonset, ignoring\n",
> +			 device->devname, devnode);
> +		return -1;
> +	}
> +
>   	if (libevdev_has_event_type(evdev, EV_ABS)) {
>
>   		if ((absinfo = libevdev_get_abs_info(evdev, ABS_X))) {
>


More information about the wayland-devel mailing list