xinput: req ChangeFeedbackControl.mask: add mask
authorChristian Linhart <chris@DemoRecorder.com>
Thu, 21 Aug 2014 20:50:52 +0000 (22:50 +0200)
committerChristian Linhart <chris@demorecorder.com>
Mon, 25 Aug 2014 11:42:56 +0000 (13:42 +0200)
add new enum ChangeFeedbackControlMask to field "mask" as mask

V2: patch revised according to suggestion from Ran Benita:
* changed item name from "ledMode" to "LedMode" ( initial character uppercase )
  to be consistent with the initial uppercase letter of the other items.

V2: added a note to the commit-message
    about multiple items with the same value.

Note:
This enum contains multiple items with the same value.
This is defined that way in the spec.
The reason is probably as follows:
The semantic of those values probably depends on the
the value of field "class_id" of struct "FeedbackCtrl".

spec and code:
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1450
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n207
http://cgit.freedesktop.org/xorg/xserver/tree/Xi/chgfctl.c

the following spec just mentions that the field "mask" is a BITMASK,
but does not list its values:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1725

src/xinput.xml

index e318339..94bdd59 100644 (file)
@@ -636,8 +636,24 @@ authorization from the authors.
         </list>
     </struct>
 
+    <enum name="ChangeFeedbackControlMask">
+        <item name="KeyClickPercent">  <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Percent">          <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Pitch">            <bit>2</bit> </item> <!-- 0x04 -->
+        <item name="Duration">         <bit>3</bit> </item> <!-- 0x08 -->
+        <item name="Led">              <bit>4</bit> </item> <!-- 0x10 -->
+        <item name="LedMode">          <bit>5</bit> </item> <!-- 0x20 -->
+        <item name="Key">              <bit>6</bit> </item> <!-- 0x40 -->
+        <item name="AutoRepeatMode">   <bit>7</bit> </item> <!-- 0x80 -->
+        <item name="String">           <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Integer">          <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelNum">         <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelDenom">       <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Threshold">        <bit>2</bit> </item> <!-- 0x04 -->
+    </enum>
+
     <request name="ChangeFeedbackControl" opcode="23">
-        <field type="CARD32"      name="mask" />
+        <field type="CARD32"      name="mask" mask="ChangeFeedbackControlMask" />
         <field type="CARD8"       name="device_id" />
         <field type="CARD8"       name="feedback_id" />
         <pad bytes="2" />