[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libinput: Changes to 'debian-unstable'



 Makefile.am                                 |    3 
 autogen.sh                                  |    6 
 configure.ac                                |   28 +
 debian/changelog                            |    9 
 debian/libinput10.symbols                   |    7 
 debian/source/local-options                 |    1 
 doc/Makefile.am                             |    8 
 doc/building.dox                            |   79 +++-
 doc/device-configuration-via-udev.dox       |    4 
 doc/faqs.dox                                |    9 
 doc/libinput.doxygen.in                     |    6 
 doc/page-hierarchy.dox                      |    3 
 doc/style/header.html                       |    2 
 doc/style/libinputdoxygen.css               |   47 ++
 doc/switches.dox                            |   16 
 doc/tapping.dox                             |   10 
 doc/touchpad-pressure.dox                   |  138 +++++++
 doc/what-is-libinput.dox                    |   54 ++
 src/Makefile.am                             |   14 
 src/evdev-lid.c                             |  302 +++++++++++++++
 src/evdev-middle-button.c                   |   36 -
 src/evdev-mt-touchpad-buttons.c             |   39 --
 src/evdev-mt-touchpad-edge-scroll.c         |   33 -
 src/evdev-mt-touchpad-gestures.c            |   33 -
 src/evdev-mt-touchpad-tap.c                 |   92 +---
 src/evdev-mt-touchpad.c                     |  395 ++++++++++++++------
 src/evdev-mt-touchpad.h                     |   40 +-
 src/evdev-tablet-pad-leds.c                 |   40 --
 src/evdev-tablet-pad.c                      |   29 -
 src/evdev-tablet-pad.h                      |   10 
 src/evdev-tablet.c                          |  101 ++---
 src/evdev-tablet.h                          |   10 
 src/evdev.c                                 |  537 ++++++++++++++--------------
 src/evdev.h                                 |  145 +++++++
 src/libinput-private.h                      |   23 +
 src/libinput-util.c                         |  129 ++++++
 src/libinput-util.h                         |   19 
 src/libinput.c                              |  153 ++++++-
 src/libinput.h                              |  139 +++++++
 src/libinput.sym                            |    9 
 src/path-seat.c                             |   29 -
 src/path-seat.h                             |    2 
 src/timer.c                                 |   28 -
 src/timer.h                                 |   10 
 src/udev-seat.c                             |   21 -
 test/Makefile.am                            |   19 
 test/generate-gcov-report.sh                |   42 ++
 test/litest-device-alps-dualpoint.c         |   74 +--
 test/litest-device-alps-semi-mt.c           |   74 +--
 test/litest-device-apple-magicmouse.c       |   19 
 test/litest-device-atmel-hover.c            |   14 
 test/litest-device-bcm5974.c                |    3 
 test/litest-device-calibrated-touchscreen.c |    3 
 test/litest-device-keyboard.c               |    3 
 test/litest-device-lid-switch-surface3.c    |   71 +++
 test/litest-device-lid-switch.c             |   70 +++
 test/litest-device-mouse-wheel-tilt.c       |   76 +++
 test/litest-device-synaptics-hover.c        |   76 +--
 test/litest-device-synaptics-st.c           |   15 
 test/litest-device-waltop-tablet.c          |    2 
 test/litest.c                               |  383 +++++++++++++++++--
 test/litest.h                               |   65 ++-
 test/test-device.c                          |  143 +++++++
 test/test-keyboard.c                        |   76 +++
 test/test-lid.c                             |  473 ++++++++++++++++++++++++
 test/test-misc.c                            |  200 ++++++++++
 test/test-pad.c                             |  131 ++++++
 test/test-path.c                            |  185 +++++----
 test/test-pointer.c                         |  374 +++++++++++++++++--
 test/test-tablet.c                          |  328 +++++++++++++++--
 test/test-touch.c                           |   72 +++
 test/test-touchpad-buttons.c                |    3 
 test/test-touchpad-tap.c                    |   63 +++
 test/test-touchpad.c                        |  261 +++++++++++++
 test/test-trackpoint.c                      |    9 
 test/test-udev.c                            |   57 ++
 tools/event-debug.c                         |  297 +++++++++------
 tools/event-gui.c                           |    4 
 tools/libinput-debug-events.man             |   12 
 tools/libinput-list-devices.c               |    2 
 tools/libinput-list-devices.man             |    2 
 tools/ptraccel-debug.c                      |    2 
 tools/shared.c                              |   24 +
 tools/shared.h                              |    1 
 udev/90-libinput-model-quirks.hwdb          |   34 +
 udev/parse_hwdb.py                          |   19 
 86 files changed, 5434 insertions(+), 1195 deletions(-)

New commits:
commit 30284fc5bc2e851da5c4dd466b013a7370075dd2
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Wed May 17 15:53:32 2017 +0300

    release to experimental

diff --git a/debian/changelog b/debian/changelog
index dd0fe6b..97b8616 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-libinput (1.7.2-1) UNRELEASED; urgency=medium
+libinput (1.7.2-1) experimental; urgency=medium
 
   * New upstream release.
   * local-options: Add test/generate-gcov-report.sh to extend-diff-
     ignore.
   * Update symbols file.
 
- -- Timo Aaltonen <tjaalton@debian.org>  Thu, 23 Mar 2017 11:55:01 +0200
+ -- Timo Aaltonen <tjaalton@debian.org>  Wed, 17 May 2017 15:53:14 +0300
 
 libinput (1.6.3-1) unstable; urgency=medium
 

commit dcf4b91c42d9e4f1355399ffdf9752f764f8d5e2
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Wed May 17 15:17:35 2017 +0300

    Update symbols file.

diff --git a/debian/changelog b/debian/changelog
index 77e09bd..dd0fe6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ libinput (1.7.2-1) UNRELEASED; urgency=medium
   * New upstream release.
   * local-options: Add test/generate-gcov-report.sh to extend-diff-
     ignore.
+  * Update symbols file.
 
  -- Timo Aaltonen <tjaalton@debian.org>  Thu, 23 Mar 2017 11:55:01 +0200
 
diff --git a/debian/libinput10.symbols b/debian/libinput10.symbols
index f98607e..edff3cb 100644
--- a/debian/libinput10.symbols
+++ b/debian/libinput10.symbols
@@ -11,6 +11,7 @@ libinput.so.10 libinput10 #MINVER#
  LIBINPUT_1.3@LIBINPUT_1.3 1.3.0
  LIBINPUT_1.4@LIBINPUT_1.4 1.4.0
  LIBINPUT_1.5@LIBINPUT_1.5 1.5.0
+ LIBINPUT_1.7@LIBINPUT_1.7 1.7.2
  libinput_config_status_to_str@LIBINPUT_0.12.0 0.15.0
  libinput_device_config_accel_get_default_profile@LIBINPUT_1.1 1.1.0
  libinput_device_config_accel_get_default_speed@LIBINPUT_0.12.0 0.15.0
@@ -120,6 +121,7 @@ libinput.so.10 libinput10 #MINVER#
  libinput_event_get_gesture_event@LIBINPUT_0.20.0 0.21.0
  libinput_event_get_keyboard_event@LIBINPUT_0.12.0 0.15.0
  libinput_event_get_pointer_event@LIBINPUT_0.12.0 0.15.0
+ libinput_event_get_switch_event@LIBINPUT_1.7 1.7.2
  libinput_event_get_tablet_pad_event@LIBINPUT_1.3 1.3.0
  libinput_event_get_tablet_tool_event@LIBINPUT_1.2 1.2.0
  libinput_event_get_touch_event@LIBINPUT_0.12.0 0.15.0
@@ -148,6 +150,11 @@ libinput.so.10 libinput10 #MINVER#
  libinput_event_pointer_get_time@LIBINPUT_0.12.0 0.15.0
  libinput_event_pointer_get_time_usec@LIBINPUT_0.21.0 0.21.0
  libinput_event_pointer_has_axis@LIBINPUT_0.12.0 0.15.0
+ libinput_event_switch_get_base_event@LIBINPUT_1.7 1.7.2
+ libinput_event_switch_get_switch@LIBINPUT_1.7 1.7.2
+ libinput_event_switch_get_switch_state@LIBINPUT_1.7 1.7.2
+ libinput_event_switch_get_time@LIBINPUT_1.7 1.7.2
+ libinput_event_switch_get_time_usec@LIBINPUT_1.7 1.7.2
  libinput_event_tablet_pad_get_base_event@LIBINPUT_1.3 1.3.0
  libinput_event_tablet_pad_get_button_number@LIBINPUT_1.3 1.3.0
  libinput_event_tablet_pad_get_button_state@LIBINPUT_1.3 1.3.0

commit 533c0a1fa8455d2a1b769e6e26f774fc9f10c6e7
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Wed May 17 14:58:32 2017 +0300

    local-options: Add test/generate-gcov-report.sh to extend-diff- ignore.

diff --git a/debian/changelog b/debian/changelog
index eda3afc..77e09bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 libinput (1.7.2-1) UNRELEASED; urgency=medium
 
   * New upstream release.
+  * local-options: Add test/generate-gcov-report.sh to extend-diff-
+    ignore.
 
  -- Timo Aaltonen <tjaalton@debian.org>  Thu, 23 Mar 2017 11:55:01 +0200
 
diff --git a/debian/source/local-options b/debian/source/local-options
index c6e3758..5c590d8 100644
--- a/debian/source/local-options
+++ b/debian/source/local-options
@@ -1 +1,2 @@
 extend-diff-ignore = "(^|/)(.vimdir|CODING_STYLE|autogen.sh|doc/*|test/50-litest.conf|tools/publish-doc)"
+extend-diff-ignore = test/generate-gcov-report.sh

commit 044bab5443b575bfe133e58b8c310191fd627972
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Wed May 17 13:46:17 2017 +0300

    bump the version

diff --git a/debian/changelog b/debian/changelog
index bd947ad..eda3afc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libinput (1.7.0-1) UNRELEASED; urgency=medium
+libinput (1.7.2-1) UNRELEASED; urgency=medium
 
   * New upstream release.
 

commit 4d6545a6a164a24228042708852e851d41f3bef8
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 5 14:51:59 2017 +1000

    configure.ac: libinput 1.7.2
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index c517593..04c0755 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([libinput_major_version], [1])
 m4_define([libinput_minor_version], [7])
-m4_define([libinput_micro_version], [1])
+m4_define([libinput_micro_version], [2])
 m4_define([libinput_version],
           [libinput_major_version.libinput_minor_version.libinput_micro_version])
 
@@ -36,7 +36,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
 # b) If interfaces have been changed or added, but binary compatibility has
 #    been preserved, change to C+1:0:A+1
 # c) If the interface is the same as the previous version, change to C:R+1:A
-LIBINPUT_LT_VERSION=22:3:12
+LIBINPUT_LT_VERSION=22:4:12
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit 09acb266f8eb8538471b6472d9588187a9b46b71
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Thu May 4 14:35:47 2017 +0300

    update the changelog

diff --git a/debian/changelog b/debian/changelog
index c1196d1..bd947ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libinput (1.7.0-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Timo Aaltonen <tjaalton@debian.org>  Thu, 23 Mar 2017 11:55:01 +0200
+
 libinput (1.6.3-1) unstable; urgency=medium
 
   * New upstream release.

commit 4ab9c15cac163e27f2b92726019c165eaecb7451
Author: Paul Kocialkowski <contact@paulk.fr>
Date:   Fri Apr 28 15:29:04 2017 +0200

    udev: Add specific pressure range for the ASUS ZenBook UX21E
    
    This adds specific pressure range values for the Elantech touchpad
    found in the ASUS ZenBook UX21E.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=99975
    
    Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 46af543b49b4e2d75348c715d1c76c2e0d432514)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 73734e6..560e77a 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -87,6 +87,9 @@ libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
  LIBINPUT_ATTR_RESOLUTION_HINT=31x31
  LIBINPUT_ATTR_PRESSURE_RANGE=10:8
 
+libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*svnASUSTeKComputerInc.:pnUX21E:*
+ LIBINPUT_ATTR_PRESSURE_RANGE=24:10
+
 ##########################################
 # Google
 ##########################################

commit 17692e5d24870e384f40ba95197396d868ab2b8b
Author: Paul Kocialkowski <contact@paulk.fr>
Date:   Fri Apr 28 15:29:03 2017 +0200

    udev: Select more generic pressure range values for Elantech touchpads
    
    The current pressure values for Elantech touchpads are too high for
    various devices and make the touchpad almost unusable on them.
    
    Decreasing the pressure range values makes those devices usable again.
    
    Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 1dfedc6995cf63e004bd3e0b1d22ae263feb7362)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index eaa9345..73734e6 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -85,7 +85,7 @@ libinput:name:* Touchpad:dmi:*svnDellInc.:*
 ##########################################
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
  LIBINPUT_ATTR_RESOLUTION_HINT=31x31
- LIBINPUT_ATTR_PRESSURE_RANGE=24:10
+ LIBINPUT_ATTR_PRESSURE_RANGE=10:8
 
 ##########################################
 # Google

commit c24abedeb4d5fc0245dfcd7e3eed3561f5767b11
Author: Paul Kocialkowski <contact@paulk.fr>
Date:   Fri Apr 28 15:29:02 2017 +0200

    udev: Remove unused Elantech touchpad model binding
    
    The Elantech touchpad model binding in udev is currently unused, since
    pressure values were moved to a udev binding of their own.
    
    This gets rid of the deprecated model binding.
    
    Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 6af9f8e5fbb9f5588eeb51185d2cc0d7f93d34ee)

diff --git a/src/evdev.c b/src/evdev.c
index 2d18bed..3b4bc4b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2245,7 +2245,6 @@ evdev_read_model_flags(struct evdev_device *device)
 		MODEL(ALPS_TOUCHPAD),
 		MODEL(SYNAPTICS_SERIAL_TOUCHPAD),
 		MODEL(JUMPING_SEMI_MT),
-		MODEL(ELANTECH_TOUCHPAD),
 		MODEL(APPLE_INTERNAL_KEYBOARD),
 		MODEL(CYBORG_RAT),
 		MODEL(CYAPA),
diff --git a/src/evdev.h b/src/evdev.h
index 465b8a3..c9a44f8 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -111,7 +111,6 @@ enum evdev_device_model {
 	EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8),
 	EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9),
 	EVDEV_MODEL_JUMPING_SEMI_MT = (1 << 10),
-	EVDEV_MODEL_ELANTECH_TOUCHPAD = (1 << 11),
 	EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12),
 	EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13),
 	EVDEV_MODEL_CYBORG_RAT = (1 << 14),
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 1b9876f..eaa9345 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -86,7 +86,6 @@ libinput:name:* Touchpad:dmi:*svnDellInc.:*
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
  LIBINPUT_ATTR_RESOLUTION_HINT=31x31
  LIBINPUT_ATTR_PRESSURE_RANGE=24:10
- LIBINPUT_MODEL_ELANTECH_TOUCHPAD=1
 
 ##########################################
 # Google

commit 8ac3c49a6198e6ec9ee08d6959f30c949f059672
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 19 14:11:45 2017 +1000

    doc: add documentation for touchpad pressure detection
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit bed7e62a0d92ccd3e985e73736b0990ac7219483)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 50fab04..af06272 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -29,6 +29,7 @@ header_files = \
 	$(srcdir)/test-suite.dox \
 	$(srcdir)/tools.dox \
 	$(srcdir)/touchpad-jumping-cursors.dox \
+	$(srcdir)/touchpad-pressure.dox \
 	$(srcdir)/touchpads.dox \
 	$(srcdir)/what-is-libinput.dox
 
diff --git a/doc/faqs.dox b/doc/faqs.dox
index 0b8db83..7820ad4 100644
--- a/doc/faqs.dox
+++ b/doc/faqs.dox
@@ -15,6 +15,11 @@ motion_normalization for a detailed explanation.
 
 See @ref tapping_default
 
+@section faq_touchpad_pressure Why does my touchpad lose track of touches
+
+The most common cause for this is an incorrect pressure threshold range.
+See @ref touchpad_pressure for more info.
+
 @section faq_kinetic_scrolling Kinetic scrolling does not work
 
 The X.Org synaptics driver implemented kinetic scrolling in the driver. It
diff --git a/doc/page-hierarchy.dox b/doc/page-hierarchy.dox
index ebfb65c..65749fe 100644
--- a/doc/page-hierarchy.dox
+++ b/doc/page-hierarchy.dox
@@ -5,6 +5,7 @@
 - @subpage clickpad_softbuttons
 - @subpage tapping
 - @subpage gestures
+- @subpage touchpad_pressure
 - @subpage palm_detection
 - @subpage t440_support
 - @subpage touchpad_jumping_cursor
diff --git a/doc/touchpad-pressure.dox b/doc/touchpad-pressure.dox
new file mode 100644
index 0000000..7c55c9f
--- /dev/null
+++ b/doc/touchpad-pressure.dox
@@ -0,0 +1,138 @@
+/**
+@page touchpad_pressure Touchpad pressure-based touch detection
+
+libinput uses the touchpad pressure values to detect wether a finger has
+been placed on the touchpad. This is @ref kernel_pressure_information and
+combines with a libinput-specific hardware database to adjust the thresholds
+on a per-device basis. libinput uses pressure thresholds primarily to filter
+out accidental light touches but pressure information is also used for
+some @ref palm_detection.
+
+Pressure thresholds are **not** directly configurable by the user, rather it
+is planned that libinput provides custom pressure thresholds for each device
+where necessary. See @ref touchpad_pressure_hwdb for instructions for your
+local device.
+
+@section kernel_pressure_information Information provided by the kernel
+
+The kernel sends multiple values to inform userspace about a finger touching
+the touchpad. The most basic is the ```EV_KEY/BTN_TOUCH``` boolean event
+that simply announces physical contact with the touchpad. The decision when
+this event is sent is usually made by the kernel driver and may depend on
+device-specific thresholds. These thresholds are transparent to userspace
+and cannot be modified.
+
+Many contemporary touchpad devices provide an absolute pressure axis in
+addition to ```BTN_TOUCH```. This pressure generally increases as the pressure
+increases, however few touchpads are capable of detection pressure. The
+pressure value is usually related to the covered area - as the pressure
+increases a finger flattens and thus covers a larger area. The range
+provided by the kernel is not mapped to a specific physical range and
+often requires adjustment. Pressure is sent by the ```ABS_PRESSURE``` axis
+for single-touch touchpads or ```ABS_MT_PRESSURE``` on multi-touch capable
+touchpads.
+
+Some devices provide additional touch size information through
+the ```ABS_MT_TOUCH_MAJOR/ABS_MT_TOUCH_MINOR``` axes and/or
+the ```ABS_MT_WIDTH_MAJOR/ABS_MT_WIDTH_MINOR``` axes. While the kernel
+documentation specifies how these axes are supposed to be mapped, few
+devices forward
+reliable information.
+
+@section touchpad_pressure_hwdb Debugging touchpad pressure ranges
+
+This section describes how to determine the touchpad pressure ranges
+required for a touchpad device and how to add the required hwdb entry
+locally. Note that the hwdb entry is **not public API** and **may change at
+any time**. Users are advised to @ref reporting_bugs "report a bug" with the
+updated pressure ranges when testing has completed.
+
+First, install the "evemu" package providing the ```evemu-record``` tool.
+Run ```evemu-record``` as root (without arguments) to see a list of devices
+and select the touchpad device. Pipe the actual output of the tool into a
+file for later analysis. For example:
+
+<pre>
+$ sudo evemu-record > touchpad-pressure.txt
+Available devices:
+/dev/input/event0:	Lid Switch
+/dev/input/event1:	Sleep Button
+/dev/input/event2:	Power Button
+/dev/input/event3:	AT Translated Set 2 keyboard
+/dev/input/event4:	SynPS/2 Synaptics TouchPad
+/dev/input/event5:	ELAN Touchscreen
+[...]
+Select the device event number [0-19]: 4
+#     Ctrl+C to quit, the output will be in touchpad-pressure.txt
+</pre>
+
+Now move a finger at **normal pressure** several times around the touchpad,
+as if moving the cursor normally around the screen. Avoid any accidental
+palm touches or any excessive or light pressure.
+
+The event recording is then filtered for pressure information, which is
+sorted and exported to a new file:
+<pre>
+$ grep --only-matching "ABS_MT_PRESSURE[ ]*[0-9]*" touchpad-pressure.txt | \
+	sed -e "s/ABS_MT_PRESSURE[ ]*//" | \
+	sort -n | uniq -c > touchpad-pressure-statistics.txt
+</pre>
+
+The file contains a list of (count, pressure-value) tuples which can be
+visualized with gnuplot. Copy the following into a file named
+```touchpad-pressure-statistics.gnuplot```:
+
+<pre>
+set style data lines
+plot 'touchpad-pressure-statistics.txt' using 2:1
+pause -1
+</pre>
+
+Now, you can visualize the touchpad pressure curve with the following
+command:
+<pre>
+$ gnuplot  touchpad-pressure-statistics.gnuplot
+</pre>
+
+The visualization will show a curve with the various pressure ranges, see
+[this bugzilla attachment](https://bugs.freedesktop.org/attachment.cgi?id=130659).
+In most cases, the thresholds can be guessed based on this curve. libinput
+employes a [Schmitt trigger](https://en.wikipedia.org/wiki/Schmitt_trigger)
+with an upper threshold and a lower threshold. A touch is detected when the
+pressure goes above the high threshold, a release is detected when the
+pressure fallse below the low threshold. Thus, an ideal threshold
+combination is with a high threshold slightly above the minimum threshold, a
+low threshold on the minimum threshold.
+
+Once the thresholds are decided on (e.g. 10 and 8), they can be enabled with
+the following hwdb file:
+
+<pre>
+$> cat /etc/udev/hwdb.d/99-touchpad-pressure.hwdb
+libinput:name:*SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq6910p*
+ LIBINPUT_ATTR_PRESSURE_RANGE=10:8
+</pre>
+
+The first line is the match line and should be adjusted for the device name
+(see evemu-record's output) and for the local system, based on the
+information in ```/sys/class/dmi/id/modalias```. The modalias should be
+shortened to the specific system's information, usually system vendor (svn)
+and product name (pn).
+
+Once in place, you need to run the following to commands, adjusted for your
+device's event node (see @ref faq_hwdb_changes):
+<pre>
+    sudo udevadm hwdb --update
+    sudo udevadm test /sys/class/input/eventX
+</pre>
+
+If the pressure range property shows up correctly, restart X or the
+Wayland compositor and libinput should now use the correct pressure
+thresholds. The @ref developer_tools can be used to verify the correct
+functionality first without the need for a restart.
+
+Once the pressure ranges are deemed correct,
+@ref reporting_bugs "report a bug" to get the pressure ranges into the
+repository.
+
+*/

commit 7079bef05fa5171136bca3bad530006072b476ed
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 19 13:45:34 2017 +1000

    touchpad: move the pressure range to a hwdb entry
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 8d5f4decb4086e2b7982c3cd1e24afd9c11f551f)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a24db9c..a35688b 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -2367,8 +2367,9 @@ tp_init_pressure(struct tp_dispatch *tp,
 		 struct evdev_device *device)
 {
 	const struct input_absinfo *abs;
-	unsigned int range;
 	unsigned int code = ABS_PRESSURE;
+	const char *prop;
+	int hi, lo;
 
 	if (tp->has_mt)
 		code = ABS_MT_PRESSURE;
@@ -2378,25 +2379,44 @@ tp_init_pressure(struct tp_dispatch *tp,
 		return;
 	}
 
-	tp->pressure.use_pressure = true;
-
 	abs = libevdev_get_abs_info(device->evdev, code);
 	assert(abs);
 
-	range = abs->maximum - abs->minimum;
+	prop = udev_device_get_property_value(device->udev_device,
+					      "LIBINPUT_ATTR_PRESSURE_RANGE");
+	if (prop) {
+		if (!parse_pressure_range_property(prop, &hi, &lo)) {
+			evdev_log_bug_client(device,
+				     "discarding invalid pressure range '%s'\n",
+				     prop);
+			return;
+		}
 
-	if (device->model_flags & EVDEV_MODEL_ELANTECH_TOUCHPAD) {
-		tp->pressure.high = 24;
-		tp->pressure.low = 10;
-	} else if (device->model_flags & EVDEV_MODEL_CYAPA) {
-		tp->pressure.high = 10;
-		tp->pressure.low = 8;
+		if (hi == 0 && lo == 0) {
+			evdev_log_info(device,
+			       "pressure-based touch detection disabled\n");
+			return;
+		}
 	} else {
+		unsigned int range = abs->maximum - abs->minimum;
+
 		/* Approximately the synaptics defaults */
-		tp->pressure.high = abs->minimum + 0.12 * range;
-		tp->pressure.low = abs->minimum + 0.10 * range;
+		hi = abs->minimum + 0.12 * range;
+		lo = abs->minimum + 0.10 * range;
+	}
+
+	if (hi > abs->maximum || hi < abs->minimum ||
+	    lo > abs->maximum || lo < abs->minimum) {
+		evdev_log_bug_libinput(device,
+			       "discarding out-of-bounds pressure range %d:%d\n",
+			       hi, lo);
+		return;
 	}
 
+	tp->pressure.use_pressure = true;
+	tp->pressure.high = hi;
+	tp->pressure.low = lo;
+
 	evdev_log_debug(device,
 			"using pressure-based touch detection\n");
 }
diff --git a/src/libinput-util.c b/src/libinput-util.c
index 351bbe4..38594fa 100644
--- a/src/libinput-util.c
+++ b/src/libinput-util.c
@@ -360,6 +360,42 @@ parse_tpkbcombo_layout_poperty(const char *prop,
 }
 
 /**
+ * Parses a string of the format "a:b" where both a and b must be integer
+ * numbers and a > b. Also allowed is the special string vaule "none" which
+ * amounts to unsetting the property.
+ *
+ * @param prop The value of the property
+ * @param hi Set to the first digit or 0 in case of 'none'
+ * @param lo Set to the second digit or 0 in case of 'none'
+ * @return true on success, false otherwise
+ */
+bool
+parse_pressure_range_property(const char *prop, int *hi, int *lo)
+{
+	int first, second;
+
+	if (!prop)
+		return false;
+
+	if (streq(prop, "none")) {
+		*hi = 0;
+		*lo = 0;
+		return true;
+	}
+
+	if (sscanf(prop, "%d:%d", &first, &second) != 2)
+		return false;
+
+	if (second >= first)
+		return false;
+
+	*hi = first;
+	*lo = second;
+
+	return true;
+}
+
+/**
  * Return the next word in a string pointed to by state before the first
  * separator character. Call repeatedly to tokenize a whole string.
  *
diff --git a/src/libinput-util.h b/src/libinput-util.h
index d86ff12..66fd336 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -378,6 +378,7 @@ int parse_mouse_wheel_click_count_property(const char *prop);
 double parse_trackpoint_accel_property(const char *prop);
 bool parse_dimension_property(const char *prop, size_t *width, size_t *height);
 bool parse_calibration_property(const char *prop, float calibration[6]);
+bool parse_pressure_range_property(const char *prop, int *hi, int *lo);
 
 enum tpkbcombo_layout {
 	TPKBCOMBO_LAYOUT_UNKNOWN,
diff --git a/test/test-misc.c b/test/test-misc.c
index 3f4b229..5101dcf 100644
--- a/test/test-misc.c
+++ b/test/test-misc.c
@@ -1001,6 +1001,48 @@ START_TEST(calibration_prop_parser)
 }
 END_TEST
 
+struct parser_test_pressure_range {
+	char *tag;
+	bool success;
+	int hi, lo;
+};
+
+START_TEST(pressure_range_prop_parser)
+{
+	struct parser_test_pressure_range tests[] = {
+		{ "10:8", true, 10, 8 },
+		{ "100:-1", true, 100, -1 },
+		{ "-203813:-502023", true, -203813, -502023 },
+		{ "238492:28210", true, 238492, 28210 },
+		{ "none", true, 0, 0 },
+		{ "0:0", false, 0, 0 },
+		{ "", false, 0, 0 },
+		{ "abcd", false, 0, 0 },
+		{ "10:30:10", false, 0, 0 },
+		{ NULL, false, 0, 0 }
+	};
+	int i;
+	int hi, lo;
+	bool success;
+
+	for (i = 0; tests[i].tag != NULL; i++) {
+		hi = lo = 0xad;
+		success = parse_pressure_range_property(tests[i].tag, &hi, &lo);
+		ck_assert(success == tests[i].success);
+		if (success) {
+			ck_assert_int_eq(hi, tests[i].hi);
+			ck_assert_int_eq(lo, tests[i].lo);
+		} else {
+			ck_assert_int_eq(hi, 0xad);
+			ck_assert_int_eq(lo, 0xad);
+		}
+	}
+
+	success = parse_pressure_range_property(NULL, NULL, NULL);
+	ck_assert(success == false);
+}
+END_TEST
+
 START_TEST(time_conversion)
 {
 	ck_assert_int_eq(us(10), 10);
@@ -1275,6 +1317,7 @@ litest_setup_tests_misc(void)
 	litest_add_no_device("misc:parser", dimension_prop_parser);
 	litest_add_no_device("misc:parser", reliability_prop_parser);
 	litest_add_no_device("misc:parser", calibration_prop_parser);
+	litest_add_no_device("misc:parser", pressure_range_prop_parser);
 	litest_add_no_device("misc:parser", safe_atoi_test);
 	litest_add_no_device("misc:parser", safe_atod_test);
 	litest_add_no_device("misc:parser", strsplit_test);
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 2ff50b6..1b9876f 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -85,6 +85,7 @@ libinput:name:* Touchpad:dmi:*svnDellInc.:*
 ##########################################
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
  LIBINPUT_ATTR_RESOLUTION_HINT=31x31
+ LIBINPUT_ATTR_PRESSURE_RANGE=24:10
  LIBINPUT_MODEL_ELANTECH_TOUCHPAD=1
 
 ##########################################
@@ -111,6 +112,7 @@ libinput:name:Atmel maXTouch Touchpad:dmi:*svn*GOOGLE*:pn*Samus*
 
 libinput:name:Cypress APA Trackpad ?cyapa?:dmi:*
  LIBINPUT_MODEL_CYAPA=1
+ LIBINPUT_ATTR_PRESSURE_RANGE=10:8
 
 ##########################################
 # HP
diff --git a/udev/parse_hwdb.py b/udev/parse_hwdb.py
index 2a342bf..97f04f4 100755
--- a/udev/parse_hwdb.py
+++ b/udev/parse_hwdb.py
@@ -112,7 +112,13 @@ def property_grammar():
                          Suppress('=') -
                          tpkbcombo_tags('VALUE')]
 
-    grammar = Or(model_props + size_props + reliability + tpkbcombo)
+    pressure_range = INTEGER('X') + Suppress(':') + INTEGER('Y')
+    pressure_prop = [ Literal('LIBINPUT_ATTR_PRESSURE_RANGE')('NAME') -
+                      Suppress('=') -
+                      Group(pressure_range('SETTINGS*')) ]
+
+    grammar = Or(model_props + size_props + reliability + tpkbcombo +
+                 pressure_prop)
 
     return grammar
 

commit 63c9cc5d750e296ba013b55cb2827044f94a54d5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 25 11:11:16 2017 +1000

    configure.ac: libinput 1.7.1
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 55dd8ef..c517593 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([libinput_major_version], [1])
 m4_define([libinput_minor_version], [7])
-m4_define([libinput_micro_version], [0])
+m4_define([libinput_micro_version], [1])
 m4_define([libinput_version],
           [libinput_major_version.libinput_minor_version.libinput_micro_version])
 
@@ -36,7 +36,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
 # b) If interfaces have been changed or added, but binary compatibility has
 #    been preserved, change to C+1:0:A+1
 # c) If the interface is the same as the previous version, change to C:R+1:A
-LIBINPUT_LT_VERSION=22:2:12
+LIBINPUT_LT_VERSION=22:3:12
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit c5f393947859c6fb9466e8bf73e760808e6972c6
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Mar 30 12:50:13 2017 +1000

    test: unset MOUSE_DPI for the apple magic mouse
    
    As of systemd commit f013e99e160f385a0c02793c612ef4c8a8ffc4d7, ID_BUS is now
    set for all bluetooth devices, not just those with subsystem bluetooth. This
    affects the Apple Magic Mouse and sets the systemd hwdb's MOUSE_DPI value.
    
    That value is different to the test results we currently have, causing some
    tests to fail because different deltas are generated (e.g.
    pointer_scroll_button).
    
    Our udev rules are prefixed 99 and thus apply after the various system rules.
    So we can't easily set ID_BUS in our rule because it'll apply after
    70-mouse.rules checks for the bustype. So we'd have to detect systemd version
    or so, but the easy way is to simply force MOUSE_DPI to the empty value. For
    our test cases it doesn't matter if the DPI is set correctly anyway.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 4030959f35a3178aa395339637e357af527da0ad)

diff --git a/test/litest-device-apple-magicmouse.c b/test/litest-device-apple-magicmouse.c
index 29d3b98..0ba84a5 100644
--- a/test/litest-device-apple-magicmouse.c
+++ b/test/litest-device-apple-magicmouse.c
@@ -88,6 +88,24 @@ static struct input_absinfo absinfo[] = {
 	{ .value = -1 }
 };
 
+/* Force MOUSE_DPI to the empty string. As of systemd commit f013e99e160f
+ * ID_BUS=bluetooth now triggers the hwdb entry for this device. This causes
+ * test case failures because deltas change. Detecting old vs new systemd is
+ * hard, and because our rules are 99-prefixed we can't set ID_BUS ourselves
+ * on older systemd.
+ * So let's go the easy way and unset MOUSE_DPI so we can continue to use
+ * the current tests.
+ */
+static const char udev_rule[] =
+"ACTION==\"remove\", GOTO=\"mouse_end\"\n"
+"KERNEL!=\"event*\", GOTO=\"mouse_end\"\n"
+"ENV{ID_INPUT_MOUSE}==\"\", GOTO=\"mouse_end\"\n"
+"\n"
+"ATTRS{name}==\"litest Apple Magic Mouse\","
+"    ENV{MOUSE_DPI}=\"\""
+"\n"
+"LABEL=\"mouse_end\"";
+
 struct litest_test_device litest_magicmouse_device = {
 	.type = LITEST_MAGICMOUSE,
 	.features = LITEST_RELATIVE | LITEST_BUTTON | LITEST_WHEEL,
@@ -99,4 +117,5 @@ struct litest_test_device litest_magicmouse_device = {
 	.id = &input_id,
 	.events = events,
 	.absinfo = absinfo,
+	.udev_rule = udev_rule,
 };

commit 51cc2088abc1a0e7175d0bcba68bf859407ba81c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 21 08:47:31 2017 +1000

    Add doc to discourage use of libinput_device_get_output_name()
    
    This is a leftover from when libinput was part of weston and we could
    interpret properties correctly. Realistically, the only way this could work
    with libinput as external library is if we define precisely what the
    definition of an output is. Practically, it's a lot easier to just throw up
    our hands and leave it all to the caller.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=100707
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
    (cherry picked from commit 7b9aa96d0230b9b1328c43e8421ddea3ffa310cb)

diff --git a/src/libinput.h b/src/libinput.h
index aa30cfa..430fe18 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -3491,6 +3491,14 @@ libinput_device_get_id_vendor(struct libinput_device *device);
  * beyond the boundaries of this output. An absolute device has its input
  * coordinates mapped to the extents of this output.
  *
+ * @note <b>Use of this function is discouraged.</b> Its return value is not
+ * precisely defined and may not be understood by the caller or may be
+ * insufficient to map the device. Instead, the system configuration could
+ * set a udev property the caller understands and interprets correctly. The
+ * caller could then obtain device with libinput_device_get_udev_device()
+ * and query it for this property. For more complex cases, the caller
+ * must implement monitor-to-device association heuristics.
+ *
  * @return The name of the output this device is mapped to, or NULL if no
  * output is set
  */

commit 1630d2ef2d8e2ef0ee765c5b3af7f38edd7025ec
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 20 20:21:43 2017 +1000

    doc: link the seats doc from the seat udev properties
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 927ad51fad1ad25497d7a2cbc538fcff742d5a6c)

diff --git a/doc/device-configuration-via-udev.dox b/doc/device-configuration-via-udev.dox
index 82a3554..cacbbf1 100644
--- a/doc/device-configuration-via-udev.dox
+++ b/doc/device-configuration-via-udev.dox
@@ -33,7 +33,7 @@ devices with the same property value are grouped into the same device group,
 the value itself is irrelevant otherwise.
 </dd>
 <dt>ID_SEAT</dt>
-<dd>Assigns the physical seat for this device. See
+<dd>Assigns the physical @ref seats "seat" for this device. See
 libinput_seat_get_physical_name(). Defaults to "seat0".</dd>
 <dt>ID_INPUT</dt>
 <dd>If this property is set, the device is considered an input device. Any
@@ -49,7 +49,7 @@ one of these may be set at any time, libinput will select only one of these
 to determine the device type. To ensure libinput selects the correct device
 type, only set one of them.</dd>
 <dt>WL_SEAT</dt>
-<dd>Assigns the logical seat for this device. See
+<dd>Assigns the logical @ref seats "seat" for this device. See
 libinput_seat_get_logical_name()
 context. Defaults to "default".</dd>
 <dt>MOUSE_DPI</dt>

commit 1061485cd2e261472073b46e4443712271d566c3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 20 11:04:44 2017 +1000

    tools: update man page for debug-events --show-keycodes flag
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 60d3b6a8edd44212f00ed7c9f837d8fcb51182f5)

diff --git a/tools/libinput-debug-events.man b/tools/libinput-debug-events.man
index bb39399..dfc9a45 100644
--- a/tools/libinput-debug-events.man
+++ b/tools/libinput-debug-events.man
@@ -2,7 +2,7 @@
 .SH NAME
 libinput-debug-events \- debug helper for libinput
 .SH SYNOPSIS
-.B libinput-debug-events [--help]
+.B libinput-debug-events [--help] [--show-keycodes]
 .SH DESCRIPTION
 .PP
 The
@@ -18,6 +18,12 @@ This tool usually needs to be run as root to have access to the
 .TP 8
 .B --help
 Print help
+.TP 8
+.B --show-keycodes
+Key events shown by this tool are partially obfuscated to avoid passwords
+and other sensitive information showing up in the output. Use the
+.B --show-keycodes


Reply to: