xinput: ev DeviceStateNotify.classes_reported: mask
authorChristian Linhart <chris@DemoRecorder.com>
Sat, 23 Aug 2014 11:05:43 +0000 (13:05 +0200)
committerChristian Linhart <chris@demorecorder.com>
Mon, 25 Aug 2014 11:42:56 +0000 (13:42 +0200)
add new enum "ClassesReportedMask" as mask to field "classes_reported"

V2: patch revised according to suggestion from Peter Harris:
* use names which indicate the way the bits should be flipped

V3: revised the diff-context according to the modification of patch 18/22 V2

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2401
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n2220

src/xinput.xml

index e81ec57..3d71da7 100644 (file)
@@ -1868,13 +1868,25 @@ authorization from the authors.
     <eventcopy name="ProximityIn"    number="8" ref="DeviceKeyPress" />
     <eventcopy name="ProximityOut"   number="9" ref="DeviceKeyPress" />
 
+    <enum name="ClassesReportedMask">
+        <item name="OutOfProximity">     <bit>7</bit> </item> <!-- 0x80 -->
+            <!-- 0 = InProxmity, 1 = OutOfProximity -->
+
+        <item name="DeviceModeAbsolute"> <bit>6</bit> </item> <!-- 0x40 -->
+            <!-- 0 = Relative, 1 = Absolute -->
+
+        <item name="ReportingValuators"> <bit>2</bit> </item> <!-- 0x04 -->
+        <item name="ReportingButtons">   <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="ReportingKeys">      <bit>0</bit> </item> <!-- 0x01 -->
+    </enum>
+
     <event name="DeviceStateNotify" number="10">
         <field type="BYTE"      name="device_id" altmask="MoreEventsMask" />
         <field type="TIMESTAMP" name="time" />
         <field type="CARD8"     name="num_keys" />
         <field type="CARD8"     name="num_buttons" />
         <field type="CARD8"     name="num_valuators" />
-        <field type="CARD8"     name="classes_reported" />
+        <field type="CARD8"     name="classes_reported" mask="ClassesReportedMask" />
         <list type="CARD8"      name="buttons">
             <value>4</value>
         </list>