diff --git a/doc/faqs.dox b/doc/faqs.dox index bc7730fb..3ef4c593 100644 --- a/doc/faqs.dox +++ b/doc/faqs.dox @@ -155,6 +155,22 @@ and don't send the required events. But they should all work nonetheless. If you have a tablet that does not work with libinput, please @ref reporting_bugs "file a bug". +@section faq_tablet_capabilities My tablet doesn't work + +If you see the message +
+libinput bug: device does not meet tablet criteria. Ignoring this device.
+
+ +or the message +
+missing tablet capabilities [...] Ignoring this device.
+
+ +your tablet device does not have the required capabilities to be treated as +a tablet. This is usually a problem with the device and the kernel driver. +See @ref tablet-capabilities for more details. + @section faq_hwdb_changes How to apply hwdb changes Sometimes users are asked to test updates to the +missing tablet capabilities: xy pen btn-stylus resolution. Ignoring this device. + +or in older versions of libinput simply: +
+libinput bug: device does not meet tablet criteria. Ignoring this device.
+
+ +When a tablet is rejected, it is usually possible to check the issue with +the `evemu-descibe` tool. + +- **xy** indicates that the tablet is missing the `ABS_X` and/or `ABS_Y` + axis. This indicates that the device is mislabelled and the udev tag + `ID_INPUT_TABLET` is applied to a device that is not a tablet. +- **pen** or **btn-stylus** indicates that the tablet does not have the + `BTN_TOOL_PEN` or `BTN_STYLUS` bit set. libinput requires either or both + of them to be present. This usually indicates a bug in the kernel driver + or the HID descriptors of the device. +- **resolution** indicates that the device does not have a resolution set + for the x and y axes. This can be fixed with a hwdb entry, locate and read + the 60-evdev.hwdb file on your machine to address this. + */ diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index d672484e..51a1434b 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -1980,29 +1980,26 @@ static int tablet_reject_device(struct evdev_device *device) { struct libevdev *evdev = device->evdev; - int rc = -1; double w, h; + bool has_xy, has_pen, has_btn_stylus, has_size; - if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) || - !libevdev_has_event_code(evdev, EV_ABS, ABS_Y)) - goto out; + has_xy = libevdev_has_event_code(evdev, EV_ABS, ABS_X) && + libevdev_has_event_code(evdev, EV_ABS, ABS_Y); + has_pen = libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN); + has_btn_stylus = libevdev_has_event_code(evdev, EV_KEY, BTN_STYLUS); + has_size = evdev_device_get_size(device, &w, &h) == 0; - if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN) && - !libevdev_has_event_code(evdev, EV_KEY, BTN_STYLUS)) - goto out; + if (has_xy && (has_pen || has_btn_stylus) && has_size) + return 0; - if (evdev_device_get_size(device, &w, &h) != 0) - goto out; - - rc = 0; - -out: - if (rc) { - evdev_log_bug_libinput(device, - "device does not meet tablet criteria. " - "Ignoring this device.\n"); - } - return rc; + evdev_log_bug_libinput(device, + "missing tablet capabilities:%s%s%s%s." + "Ignoring this device.\n", + has_xy ? "" : " xy", + has_pen ? "" : " pen", + has_btn_stylus ? "" : " btn-stylus", + has_size ? "" : " resolution"); + return -1; } static int