Commit graph

507 commits

Author SHA1 Message Date
Hans de Goede
9cf548e770 touchpad: Add support for top softbutton area
Add support for the top softbutton area found on some laptops.

For details of how this works, see the updated
doc/touchpad-softbutton-state-machine.svg diagram.

Basically this mirrors the state-machine for the bottom softbutton area, with
one exception, if a finger stays at least inner timeout milliseconds in the
top button area and then moves out of it, it will be ignored rather then
become the pointer. This is done so that people using the top buttons together
with a trackstick and accidentally move their finger out of the upper area
don't get spurious pointer movements from the finger on the trackpad.

This behavior is indentical to xf86-input-synaptics, which also ignores
movements from touches which start in the top button area.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-02 14:01:23 +10:00
Hans de Goede
bfe05ed4a6 touchpad: softbuttons: Deal with a click arriving before any touches
It is possible for a click to get reported before any related touch events
get reported, here is the relevant part of an evemu-record session on a T440s:

E: 3.985585 0000 0000 0000	# ------------ SYN_REPORT (0) ----------
E: 3.997419 0003 0039 -001	# EV_ABS / ABS_MT_TRACKING_ID   -1
E: 3.997419 0001 014a 0000	# EV_KEY / BTN_TOUCH            0
E: 3.997419 0003 0018 0000	# EV_ABS / ABS_PRESSURE         0
E: 3.997419 0001 0145 0000	# EV_KEY / BTN_TOOL_FINGER      0
E: 3.997419 0000 0000 0000	# ------------ SYN_REPORT (0) ----------
E: 5.117881 0001 0110 0001	# EV_KEY / BTN_LEFT             1
E: 5.117881 0000 0000 0000	# ------------ SYN_REPORT (0) ----------
E: 5.133422 0003 0039 0187	# EV_ABS / ABS_MT_TRACKING_ID   187
E: 5.133422 0003 0035 3098	# EV_ABS / ABS_MT_POSITION_X    3098
E: 5.133422 0003 0036 3282	# EV_ABS / ABS_MT_POSITION_Y    3282
E: 5.133422 0003 003a 0046	# EV_ABS / ABS_MT_PRESSURE      46
E: 5.133422 0001 014a 0001	# EV_KEY / BTN_TOUCH            1
E: 5.133422 0003 0000 3102	# EV_ABS / ABS_X                3102
E: 5.133422 0003 0001 3282	# EV_ABS / ABS_Y                3282
E: 5.133422 0003 0018 0046	# EV_ABS / ABS_PRESSURE         46
E: 5.133422 0001 0145 0001	# EV_KEY / BTN_TOOL_FINGER      1
E: 5.133422 0000 0000 0000	# ------------ SYN_REPORT (0) ----------

Notice the BTN_LEFT event all by itself!

To deal with this if a physical click registers before we get any touches,
wait for the first touch to resolve the click.

Also see the new activity diagram for the tp_post_softbutton_buttons
method which has been added to doc/touchpad-softbutton-state-machine.svg

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-05-22 14:51:41 +02:00
Peter Hutterer
e192ecc6e9 touchpad: Add clickpad-style software buttons
Almost all non Apple touchpads have visible markings for software button areas,
so limit clickfinger behavior to Apple clickpads, and implement software button
areas for others.

This is a slightly fancier implementation than the simplest model and ported
over from libtouchpad. It implements a state machine for the software buttons
with left and right buttons currently implemented. Buttons are oriented
left-to-right, in a horizontal bar. No random button placement allowed.

In general, the procedure is:
- if a finger sets down in the left button area, a click is a left click
- if a finger sets down in the right button area, a click is a right click
- if a finger leaves the button area, a click is a left click
- if a finger starts outside the button area, a click is a left click

Two timeouts are used to handle buttons more smoothly:
- if a finger sets down in a button area but "immediately" moves over
  to a different area, that area takes effect on a click.
- if a finger leaves a button area and "immediately" clicks or moves back into
  the area, the button still takes effect on a click.
- if a finger changes between areas and stays there for a timeout, that area
  takes effect on a click.

Note the button area states are named BOTTOM_foo to make it easier to later
add support for a top button area such as can be found on the Thinkpad [2-5]40
series.

Co-authored-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-05-22 14:44:55 +02:00
Peter Hutterer
1c0805a559 doc: add state machine SVG to EXTRA_DIST
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-05-22 14:39:01 +02:00
Peter Hutterer
d4bd05184a touchpad: add support for multi-finger tapping
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-24 14:56:40 +10:00
Peter Hutterer
e13d0c8248 doc: extract static members as well
We only run doxygen over the public headers, so if we have a static function
in those make sure they show up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-21 12:11:03 +01:00
Peter Hutterer
2d2df7842c doc: hook up doxygen to generate the public API documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-07 14:06:46 +01:00