mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-26 08:20:21 +01:00
tablet: print what capability is missing when rejecting a device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ed52002c8d
commit
940658e1b7
3 changed files with 59 additions and 19 deletions
16
doc/faqs.dox
16
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
|
||||
<pre>
|
||||
libinput bug: device does not meet tablet criteria. Ignoring this device.
|
||||
</pre>
|
||||
|
||||
or the message
|
||||
<pre>
|
||||
missing tablet capabilities [...] Ignoring this device.
|
||||
</pre>
|
||||
|
||||
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 <a
|
||||
|
|
|
|||
|
|
@ -344,4 +344,31 @@ libinput uses the @ref libinput_device_group to decide on touch arbitration
|
|||
and automatically discards touch events whenever a tool is in proximity.
|
||||
The exact behavior is device-dependent.
|
||||
|
||||
@section tablet-capabilities Required tablet capabilities
|
||||
|
||||
To handle a tablet correctly, libinput requires a set of capabilities
|
||||
on the device. When these capabilities are missing, libinput ignores the
|
||||
device and prints an error to the log. This error messages reads
|
||||
<pre>
|
||||
missing tablet capabilities: xy pen btn-stylus resolution. Ignoring this device.
|
||||
</pre>
|
||||
or in older versions of libinput simply:
|
||||
<pre>
|
||||
libinput bug: device does not meet tablet criteria. Ignoring this device.
|
||||
</pre>
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue