[PATCH RFC inputproto] Add WrapAround axis flag

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 15 23:03:47 PDT 2011


Some devices (e.g. Intuos 4) have axes that are ring-shaped and thus jump
from min→max or max→min. Clients (and the server) should know about this.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
This is a must-have if we want to have scroll button emulation in the
server. Currently, this functionality is in the driver and does the
detection for us but switching to smooth scrolling makes the scroll ring
flaky.

Besides, exporting this information to the client may be of use to them too.

 XI2.h              |    1 +
 specs/XI2proto.txt |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/XI2.h b/XI2.h
index 819e68f..93a691f 100644
--- a/XI2.h
+++ b/XI2.h
@@ -145,6 +145,7 @@
 /* Axis flags */
 #define XIAxisVertScroll                        (1 << 0)
 #define XIAxisHorizScroll                       (1 << 1)
+#define XIAxisWrapAround                        (1 << 2)
 
 /* Device event flags (common) */
 /* Device event flags (key events only) */
diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
index 35d4fa2..20454a6 100644
--- a/specs/XI2proto.txt
+++ b/specs/XI2proto.txt
@@ -143,6 +143,10 @@ Any server providing this behaviour marks emulated button or valuator events
 with the XIPointerEmulated flag for DeviceEvents, and the XIRawEmulated flag
 for raw events, to hint at applications which event is a hardware event.
 
+If an axis is flagged as WrapAround, the server attempts wrap-around
+detection and generates the scroll events taking a potential wrap-around
+into account.
+
 The behavior of scroll button emulation if there is more than one VertScroll
 or more than one HorizScroll axes on the same device is implementation-
 dependent.
@@ -363,7 +367,7 @@ If major_version is less than 2, a BadValue error occurs.
 
     * since XI 2.1
 
-    AXISFLAGS { VertScroll, HorizScroll }
+    AXISFLAGS { VertScroll, HorizScroll, WrapAround }
 
 
 XIQueryDevice details information about the requested input devices.
@@ -468,6 +472,8 @@ The following classes may occur only once: ButtonClass, KeyClass
         A set of flags describing additional axis information
         VertScroll: This axis is a vertical scrolling axis
         HorizScroll: This axis is a horizontal scrolling axis
+        WrapAround: This axis is a ring and wraps from max to min or
+                    min to max.
 
 An axis in Relative mode may specify min and max as a hint to the
 client. If no min and max information is available, both must be 0.
-- 
1.7.6


More information about the xorg-devel mailing list