summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-03-19 14:04:59 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-03-21 11:27:27 +1000
commita75e1c35332b0803f600e326625dd0056df61317 (patch)
treeb24e4a8a3ad2069d4d5a4d5650eb6a070b3c2484
parent66a78e339177bf70cf25c1810e3097558103ac37 (diff)
downloadlibevdev-a75e1c35332b0803f600e326625dd0056df61317.tar.gz
Add documentation for axis updates without a tracking ID
If a touch starts and terminates while in SYN_DROPPED, the tracking ID appears to stay at -1, but the other axes may update. We need to pass these on to the client since the kernel may buffer the next event with the same value otherwise. Note this in the documentation so that client's don't create touch points based on out-of-touchpoint updates. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
-rw-r--r--libevdev/libevdev.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
index 8e50a4e..77ee08a 100644
--- a/libevdev/libevdev.h
+++ b/libevdev/libevdev.h
@@ -309,6 +309,55 @@ extern "C" {
* in slot 1 maintained the same ABS_MT_TRACKING_ID and only updated the
* coordinates. Slot 1 is the currently active slot.
*
+ * In the case of a SYN_DROPPED event, a touch point may be invisible to a
+ * client if it started after SYN_DROPPED and finished before the client
+ * handles events again. The below example shows an example event sequence
+ * and what libevdev sees in the case of a SYN_DROPPED event:
+ * @code
+
+ kernel | userspace
+ |
+ EV_ABS ABS_MT_SLOT 0 | EV_ABS ABS_MT_SLOT 0
+ EV_ABS ABS_MT_TRACKING_ID -1 | EV_ABS ABS_MT_TRACKING_ID -1
+ EV_SYN SYN_REPORT 0 | EV_SYN SYN_REPORT 0
+ ------------------------ | ------------------------
+ EV_ABS ABS_MT_TRACKING_ID 30 |
+ EV_ABS ABS_MT_POSITION_X 100 |
+ EV_ABS ABS_MT_POSITION_Y 80 |
+ EV_SYN SYN_REPORT 0 | SYN_DROPPED
+ ------------------------ |
+ EV_ABS ABS_MT_TRACKING_ID -1 |
+ EV_SYN SYN_REPORT 0 |
+ ------------------------ | ------------------------
+ EV_ABS ABS_MT_SLOT 1 | EV_ABS ABS_MT_SLOT 1
+ EV_ABS ABS_MT_POSITION_X 90 | EV_ABS ABS_MT_POSITION_X 90
+ EV_ABS ABS_MT_POSITION_Y 10 | EV_ABS ABS_MT_POSITION_Y 10
+ EV_SYN SYN_REPORT 0 | EV_SYN SYN_REPORT 0
+ * @endcode
+ * If such an event sequence occurs, libevdev will send all updated axes
+ * during the sync process. Axis events may thus be generated for devices
+ * without a currently valid ABS_MT_TRACKING_ID. Specifically for the above
+ * example, the client would receive the following event sequence:
+ * @code
+ EV_ABS ABS_MT_SLOT 0 ← LIBEVDEV_READ_FLAG_NORMAL
+ EV_ABS ABS_MT_TRACKING_ID -1
+ EV_SYN SYN_REPORT 0
+ ------------------------
+ EV_SYN SYN_DROPPED 0 → LIBEVDEV_READ_STATUS_SYNC
+ ------------------------
+ EV_ABS ABS_MT_POSITION_X 100 ← LIBEVDEV_READ_FLAG_SYNC
+ EV_ABS ABS_MT_POSITION_Y 80
+ EV_SYN SYN_REPORT 0
+ ----------------------------- → -EGAIN
+ EV_ABS ABS_MT_SLOT 1 ← LIBEVDEV_READ_FLAG_NORMAL
+ EV_ABS ABS_MT_POSITION_X 90
+ EV_ABS ABS_MT_POSITION_Y 10
+ EV_SYN SYN_REPORT 0
+ -------------------
+ * @endcode
+ * The axis events do not reflect the position of a current touch point, a
+ * client must take care not to generate a new touch point based on those
+ * updates.
*/
/**