# -rw-r--r-- 4.8 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 <interface name="xr_hand_v1" version="1">
    <description summary="OpenXR hand tracking">
      The xr_hand_v1 interface represents a physical hand in a 3D space owned
      by the compositor.

      It is based on the OpenXR XR_EXT_hand_tracking extension.
    </description>

    <enum name="hand">
      <description summary="XrHandEXT">
        Describes which hand the xr_hand_v1 interface is representing.
      </description>
      <entry name="left" value="0"/>
      <entry name="right" value="1"/>
    </enum>

    <event name="handedness">
      <description summary="Physical tracking handedness">
        The compositor will send this event once, when the xr_hand_v1
        interface is bound.

        Handedness should not change during runtime.
      </description>
      <arg name="hand" type="uint" enum="hand"/>
    </event>

    <enum name="joint">
      <description summary="XrHandJointEXT">
        Describes the 26 individual hand joints used for tracking. The palm,
        the writs, 4 joints for the thumb and 5 for the other fingers.
      </description>
      <entry name="palm" value="0"/>
      <entry name="wrist" value="1"/>
      <entry name="thumb_metacarpal" value="2"/>
      <entry name="thumb_proximal" value="3"/>
      <entry name="thumb_distal" value="4"/>
      <entry name="thumb_tip" value="5"/>
      <entry name="index_metacarpal" value="6"/>
      <entry name="index_proximal" value="7"/>
      <entry name="index_intermediate" value="8"/>
      <entry name="index_distal" value="9"/>
      <entry name="index_tip" value="10"/>
      <entry name="middle_metacarpal" value="11"/>
      <entry name="middle_proximal" value="12"/>
      <entry name="middle_intermediate" value="13"/>
      <entry name="middle_distal" value="14"/>
      <entry name="middle_tip" value="15"/>
      <entry name="ring_metacarpal" value="16"/>
      <entry name="ring_proximal" value="17"/>
      <entry name="ring_intermediate" value="18"/>
      <entry name="ring_distal" value="19"/>
      <entry name="ring_tip" value="20"/>
      <entry name="little_metacarpal" value="21"/>
      <entry name="little_proximal" value="22"/>
      <entry name="little_intermediate" value="23"/>
      <entry name="little_distal" value="24"/>
      <entry name="little_tip" value="25"/>
    </enum>

    <event name="joints">
      <description summary="joints pose">
        Sends two wl_array of exactly 26 elements (see the joint enum above),
        representing the position (in vec3) and orientation (quat x,y,z,w) of
        each individual joint at a given time.
      </description>
      <arg name="positions" type="array" summary="vec3"/>
      <arg name="orientations" type="array" summary="quat (x,y,z,w)"/>
      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
    </event>

    <enum name="gesture_state">
      <description summary="hand gesture state">
        Describes the gesture that the hand is physically doing.
      </description>
      <entry name="neutral" value="0" summary="default state"/>
      <entry name="fist" value="1"
        summary= "all the fingers bent against the palm"/>
      <entry name="pinch" value="2" summary="thumb and index tip touching"/>
      <!-- The position of the thumb here is optional -->
      <entry name="point" value="3"
        summary="index straight, rest of the fingers bent against the palm"/>
    </enum>

    <event name="gesture">
      <description summary="hand gesture event">
        Indicates a change of gesture from the hand. If no event is sent before
        the frame event, the state is presumed unchanged.

        Clients are encouraged to keep track of the current gesture state.
      </description>
      <arg name="state" type="uint" enum="gesture"/>
    </event>

    <event name="pose">
      <description summary="XrPosef">
        Pose associated to the hand gesture. Depending on the current hand
        state, argument must be read differently.

        - For the neutral and fist state, the pose represents the palm of the
        hand.
        - For pinch, the pose represents the point between the thumb and index
        tip.
        - For point, it represents the aim from the tip of the index.
      </description>
      <arg name="position" type="array" summary="OpenXR XrVector3f"/>
      <arg name="orientation" type="array" summary="OpenXR XrQuaternionf"/>
      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
    </event>

    <event name="frame">
      <description summary="end of hand frame event">
        Indicates the end of the hand events that logically belong together.
        A client is expected to accumulate the data in all evetns within the
        frame before proceeding.

        All xr_hand_v1 events before a xr_hand_v1.frame event belong logically
        tohgether.
      </description>
    </event>
  </interface>