• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="gaming_input_unstable_v1">
3
4  <copyright>
5    Copyright 2016 The Chromium Authors.
6
7    Permission is hereby granted, free of charge, to any person obtaining a
8    copy of this software and associated documentation files (the "Software"),
9    to deal in the Software without restriction, including without limitation
10    the rights to use, copy, modify, merge, publish, distribute, sublicense,
11    and/or sell copies of the Software, and to permit persons to whom the
12    Software is furnished to do so, subject to the following conditions:
13
14    The above copyright notice and this permission notice (including the next
15    paragraph) shall be included in all copies or substantial portions of the
16    Software.
17
18    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24    DEALINGS IN THE SOFTWARE.
25  </copyright>
26
27  <interface name="zcr_gaming_input_v1" version="1">
28    <description summary="extends wl_seat with gaming input devices">
29      A global interface to provide gaming input devices for a given seat.
30
31      Currently only gamepad devices are supported.
32
33      Warning! The protocol described in this file is experimental and
34      backward incompatible changes may be made. Backward compatible changes
35      may be added together with the corresponding uinterface version bump.
36      Backward incompatible changes are done by bumping the version number in
37      the protocol and uinterface names and resetting the interface version.
38      Once the protocol is to be declared stable, the 'z' prefix and the
39      version number in the protocol and interface names are removed and the
40      interface version number is reset.
41    </description>
42
43    <request name="get_gamepad">
44      <description summary="get gamepad device assigned to seat">
45        Create gamepad object. See zcr_gamepad_v1 interface for details.
46      </description>
47      <arg name="id" type="new_id" interface="zcr_gamepad_v1"/>
48      <arg name="seat" type="object" interface="wl_seat"/>
49    </request>
50  </interface>
51
52  <interface name="zcr_gamepad_v1" version="1">
53    <description summary="gamepad input device">
54      The zcr_gamepad_v1 interface represents one or more gamepad input devices,
55      which are reported as a normalized 'Standard Gamepad' as it is specified
56      by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
57    </description>
58
59    <request name="destroy" type="destructor">
60      <description summary="destroy gamepad object"/>
61    </request>
62
63    <enum name="gamepad_state">
64      <description summary="connection state"/>
65      <entry name="off" value="0" summary="no gamepads are connected or on."/>
66      <entry name="on" value="1" summary="at least one gamepad is connected."/>
67    </enum>
68
69    <event name="state_change">
70      <description summary="state change event">
71        Notification that this seat's connection state has changed.
72      </description>
73      <arg name="state" type="uint" enum="gamepad_state" summary="new state"/>
74    </event>
75
76    <event name="axis">
77      <description summary="axis change event">
78        Notification of axis change.
79
80        The axis id specifies which axis has changed as defined by the W3C
81        'Standard Gamepad'.
82
83        The value is calibrated and normalized to the -1 to 1 range.
84      </description>
85      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
86      <arg name="axis" type="uint" summary="axis that produced this event"/>
87      <arg name="value" type="fixed" summary="new value of axis"/>
88    </event>
89
90    <enum name="button_state">
91      <description summary="physical button state">
92        Describes the physical state of a button that produced the button
93        event.
94      </description>
95      <entry name="released" value="0" summary="the button is not pressed"/>
96      <entry name="pressed" value="1" summary="the button is pressed"/>
97    </enum>
98
99    <event name="button">
100      <description summary="Gamepad button changed">
101        Notification of button change.
102
103        The button id specifies which button has changed as defined by the W3C
104        'Standard Gamepad'.
105
106        A button can have a digital and an analog value. The analog value is
107        normalized to a 0 to 1 range.
108        If a button does not provide an analog value, it will be derived from
109        the digital state.
110      </description>
111      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
112      <arg name="button" type="uint" summary="id of button"/>
113      <arg name="state" type="uint" enum="button_state" summary="digital state of the button"/>
114      <arg name="analog" type="fixed" summary="analog value of the button"/>
115    </event>
116
117    <event name="frame">
118      <description summary="Notifies end of a series of gamepad changes.">
119        Indicates the end of a set of events that logically belong together.
120        A client is expected to accumulate the data in all events within the
121        frame before proceeding.
122      </description>
123      <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
124    </event>
125  </interface>
126
127</protocol>
128