2018-07-10 17:32:35 +10:00
|
|
|
.. _absolute_coordinate_ranges:
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
Coordinate ranges for absolute axes
|
|
|
|
|
==============================================================================
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
libinput requires that all touchpads provide a correct axis range and
|
|
|
|
|
resolution. These are used to enable or disable certain features or adapt
|
|
|
|
|
the interaction with the touchpad. For example, the software button area is
|
|
|
|
|
narrower on small touchpads to avoid reducing the interactive surface too
|
|
|
|
|
much. Likewise, palm detection works differently on small touchpads as palm
|
|
|
|
|
interference is less likely to happen.
|
|
|
|
|
|
|
|
|
|
Touchpads with incorrect axis ranges generate error messages
|
|
|
|
|
in the form:
|
|
|
|
|
<blockquote>
|
|
|
|
|
Axis 0x35 value 4000 is outside expected range [0, 3000]
|
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
|
|
This error message indicates that the ABS_MT_POSITION_X axis (i.e. the x
|
|
|
|
|
axis) generated an event outside the expected range of 0-3000. In this case
|
|
|
|
|
the value was 4000.
|
|
|
|
|
This discrepancy between the coordinate range the kernels advertises vs.
|
|
|
|
|
what the touchpad sends can be the source of a number of perceived
|
|
|
|
|
bugs in libinput.
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
.. _absolute_coordinate_ranges_fix:
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
Measuring and fixing touchpad ranges
|
|
|
|
|
------------------------------------------------------------------------------
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
To fix the touchpad you need to:
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
#. measure the physical size of your touchpad in mm
|
|
|
|
|
#. run touchpad-edge-detector
|
|
|
|
|
#. trim the udev match rule to something sensible
|
|
|
|
|
#. replace the resolution with the calculated resolution based on physical settings
|
|
|
|
|
#. test locally
|
|
|
|
|
#. send a patch to the systemd project
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
Detailed explanations are below.
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
`libevdev <http://freedesktop.org/wiki/Software/libevdev/>`_ provides a tool
|
2016-05-31 14:52:57 +10:00
|
|
|
called **touchpad-edge-detector** that allows measuring the touchpad's input
|
|
|
|
|
ranges. Run the tool as root against the device node of your touchpad device
|
|
|
|
|
and repeatedly move a finger around the whole outside area of the
|
|
|
|
|
touchpad. Then control+c the process and note the output.
|
|
|
|
|
An example output is below:
|
|
|
|
|
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
::
|
|
|
|
|
|
|
|
|
|
$> sudo touchpad-edge-detector /dev/input/event4
|
|
|
|
|
Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event4
|
|
|
|
|
Move one finger around the touchpad to detect the actual edges
|
|
|
|
|
Kernel says: x [1024..3112], y [2024..4832]
|
|
|
|
|
Touchpad sends: x [2445..4252], y [3464..4071]
|
|
|
|
|
|
|
|
|
|
Touchpad size as listed by the kernel: 49x66mm
|
|
|
|
|
Calculate resolution as:
|
2016-05-31 14:52:57 +10:00
|
|
|
x axis: 2088/<width in mm>
|
|
|
|
|
y axis: 2808/<height in mm>
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
Suggested udev rule:
|
|
|
|
|
# <Laptop model description goes here>
|
|
|
|
|
evdev:name:SynPS/2 Synaptics TouchPad:dmi:bvnLENOVO:bvrGJET72WW(2.22):bd02/21/2014:svnLENOVO:pn20ARS25701:pvrThinkPadT440s:rvnLENOVO:rn20ARS25701:rvrSDK0E50512STD:cvnLENOVO:ct10:cvrNotAvailable:*
|
|
|
|
|
EVDEV_ABS_00=2445:4252:<x resolution>
|
|
|
|
|
EVDEV_ABS_01=3464:4071:<y resolution>
|
|
|
|
|
EVDEV_ABS_35=2445:4252:<x resolution>
|
|
|
|
|
EVDEV_ABS_36=3464:4071:<y resolution>
|
|
|
|
|
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Note the discrepancy between the coordinate range the kernels advertises vs.
|
|
|
|
|
what the touchpad sends.
|
|
|
|
|
To fix the advertised ranges, the udev rule should be taken and trimmed
|
2018-07-10 17:32:35 +10:00
|
|
|
before being sent to the `systemd project <https://github.com/systemd/systemd>`_.
|
2016-05-31 14:52:57 +10:00
|
|
|
An example commit can be found
|
2018-07-10 17:32:35 +10:00
|
|
|
`here <https://github.com/systemd/systemd/commit/26f667eac1c5e89b689aa0a1daef6a80f473e045>`_.
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
In most cases the match can and should be trimmed to the system vendor (svn)
|
|
|
|
|
and the product version (pvr), with everything else replaced by a wildcard
|
2018-07-10 17:32:35 +10:00
|
|
|
(*). In this case, a Lenovo T440s, a suitable match string would be:
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*pvrThinkPadT440s*
|
2016-05-31 14:52:57 +10:00
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
.. note:: hwdb match strings only allow for alphanumeric ascii characters. Use a
|
2018-07-24 12:30:07 +10:00
|
|
|
wildcard (* or ?, whichever appropriate) for special characters.
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
The actual axis overrides are in the form:
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# axis number=min:max:resolution
|
|
|
|
|
EVDEV_ABS_00=2445:4252:42
|
|
|
|
|
|
2016-05-31 14:52:57 +10:00
|
|
|
or, if the range is correct but the resolution is wrong
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
# axis number=::resolution
|
|
|
|
|
EVDEV_ABS_00=::42
|
|
|
|
|
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
Note the leading single space. The axis numbers are in hex and can be found
|
|
|
|
|
in *linux/input-event-codes.h*. For touchpads ABS_X, ABS_Y,
|
|
|
|
|
ABS_MT_POSITION_X and ABS_MT_POSITION_Y are required.
|
|
|
|
|
|
2018-07-10 17:32:35 +10:00
|
|
|
.. note:: The touchpad's ranges and/or resolution should only be fixed when
|
2018-07-24 12:30:07 +10:00
|
|
|
there is a significant discrepancy. A few units do not make a
|
|
|
|
|
difference and a resolution that is off by 2 or less usually does
|
|
|
|
|
not matter either.
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
Once a match and override rule has been found, follow the instructions at
|
|
|
|
|
the top of the
|
2018-07-10 17:32:35 +10:00
|
|
|
`60-evdev.hwdb <https://github.com/systemd/systemd/blob/master/hwdb/60-evdev.hwdb>`_
|
2016-05-31 14:52:57 +10:00
|
|
|
file to save it locally and trigger the udev hwdb reload. Rebooting is
|
|
|
|
|
always a good idea. If the match string is correct, the new properties will
|
|
|
|
|
show up in the
|
|
|
|
|
output of
|
2018-07-10 17:32:35 +10:00
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
udevadm info /sys/class/input/event4
|
|
|
|
|
|
2016-05-31 14:52:57 +10:00
|
|
|
|
|
|
|
|
Adjust the command for the event node of your touchpad.
|
|
|
|
|
A udev builtin will apply the new axis ranges automatically.
|
|
|
|
|
|
2018-04-10 07:58:31 +10:00
|
|
|
When the axis override is confirmed to work, please submit it as a pull
|
2018-07-10 17:32:35 +10:00
|
|
|
request to the `systemd project <https://github.com/systemd/systemd>`_.
|