1<?xml version="1.0" encoding="UTF-8"?> 2<protocol name="gaming_input_unstable_v2"> 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_v2" 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_gaming_seat"> 44 <description summary="get a gaming seat"> 45 Get a gaming seat object for a given seat. Gaming seat provides access 46 to gaming devices 47 </description> 48 <arg name="gaming_seat" type="new_id" interface="zcr_gaming_seat_v2"/> 49 <arg name="seat" type="object" interface="wl_seat"/> 50 </request> 51 52 <request name="destroy" type="destructor"> 53 <description summary="release the memory for the gaming input object"> 54 Destroy gaming_input object. Objects created from this object are 55 unaffected and should be destroyed separately. 56 </description> 57 </request> 58 </interface> 59 60 <interface name="zcr_gaming_seat_v2" version="1"> 61 <description summary="controller object for all gaming devices of a seat"> 62 An object that provides access to all the gaming devices of a seat. 63 When a gamepad is connected, the compositor will send gamepad_added event. 64 </description> 65 66 <request name="destroy" type="destructor"> 67 <description summary="release the memory for the gaming seat object"> 68 Destroy gaming_seat object. Objects created from this object are 69 unaffected and should be destroyed separately. 70 </description> 71 </request> 72 73 <event name="gamepad_added"> 74 <description summary="gamepad added event"> 75 Notification that there is gamepad connected at this seat. 76 </description> 77 <arg name="gamepad" type="new_id" interface="zcr_gamepad_v2" summary="new connected gamepad"/> 78 </event> 79 80 <enum name="bus_type"> 81 <description summary="gamepad device bus type"> 82 Device connection type e.g. Bluetooth 83 </description> 84 <entry name="usb" value="0" summary="Universal Serial Bus" /> 85 <entry name="bluetooth" value="1" summary="Bluetooth" /> 86 </enum> 87 88 <event name="gamepad_added_with_device_info"> 89 <description summary="gamepad added event"> 90 Notification that there is gamepad connected at this seat. 91 </description> 92 <arg name="gamepad" type="new_id" interface="zcr_gamepad_v2" summary="new connected gamepad"/> 93 <arg name="name" type="string" summary="name of the gamepad device" /> 94 <arg name="bus" type="uint" enum="bus_type" summary="type of the device connection e.g. Bluetooth" /> 95 <arg name="vendor_id" type="uint" summary="vendor ID of the gamepad device" /> 96 <arg name="product_id" type="uint" summary="product ID of the gamepad device" /> 97 <arg name="version" type="uint" summary="product version of the gamepad device" /> 98 </event> 99 </interface> 100 101 <interface name="zcr_gamepad_v2" version="1"> 102 <description summary="gamepad input device"> 103 The zcr_gamepad_v2 interface represents one or more gamepad input devices, 104 which are reported as a normalized 'Standard Gamepad' as it is specified 105 by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping 106 </description> 107 108 <request name="destroy" type="destructor"> 109 <description summary="destroy gamepad object"/> 110 </request> 111 112 <event name="removed"> 113 <description summary="gamepad removed"> 114 Removed event is send when the gamepad is disconnected. The client should 115 expect no more event and call destroy. 116 117 This event cannot be used as destructor as requests (e.g. vibration) might 118 be added to this interface. 119 </description> 120 </event> 121 122 <event name="axis"> 123 <description summary="axis change event"> 124 Notification of axis change. 125 126 The axis id specifies which axis has changed as defined by the W3C 127 'Standard Gamepad'. 128 129 The value is calibrated and normalized to the -1 to 1 range. 130 </description> 131 <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> 132 <arg name="axis" type="uint" summary="axis that produced this event"/> 133 <arg name="value" type="fixed" summary="new value of axis"/> 134 </event> 135 136 <enum name="button_state"> 137 <description summary="physical button state"> 138 Describes the physical state of a button that produced the button 139 event. 140 </description> 141 <entry name="released" value="0" summary="the button is not pressed"/> 142 <entry name="pressed" value="1" summary="the button is pressed"/> 143 </enum> 144 145 <event name="button"> 146 <description summary="Gamepad button changed"> 147 Notification of button change. 148 149 The button id specifies which button has changed as defined by the W3C 150 'Standard Gamepad'. 151 152 A button can have a digital and an analog value. The analog value is 153 normalized to a 0 to 1 range. 154 If a button does not provide an analog value, it will be derived from 155 the digital state. 156 </description> 157 <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> 158 <arg name="button" type="uint" summary="id of button"/> 159 <arg name="state" type="uint" enum="button_state" summary="digital state of the button"/> 160 <arg name="analog" type="fixed" summary="analog value of the button"/> 161 </event> 162 163 <event name="frame"> 164 <description summary="Notifies end of a series of gamepad changes."> 165 Indicates the end of a set of events that logically belong together. 166 A client is expected to accumulate the data in all events within the 167 frame before proceeding. 168 </description> 169 <arg name="time" type="uint" summary="timestamp with millisecond granularity"/> 170 </event> 171 172 <event name="axis_added"> 173 <description summary="an axis is added"> 174 Adds an axis to the gamepad. Only called when the gamepad was created by 175 gamepad_added_with_device_info. The values are compatible with 176 input_absinfo. 177 </description> 178 <arg name="index" type="uint" summary="An index of the axis" /> 179 <arg name="min_value" type="int" summary="minimum value of the axis" /> 180 <arg name="max_value" type="int" summary="maximum value of the axis" /> 181 <arg name="flat" type="int" summary="input within this value are ignored" /> 182 <arg name="fuzz" type="int" summary="used to filter noise" /> 183 <arg name="resolution" type="int" summary="resolution of input in units per millimeter, or units per radian for rotational axes." /> 184 </event> 185 186 <event name="activated"> 187 <description summary="Gamepad activated"> 188 Activates the gamepad i.e. the gamepad will be visible to applications 189 after this event is fired. All axis_added events should be sent before 190 this event. Only called when the gamepad was created by 191 gamepad_added_with_device_info. 192 </description> 193 </event> 194 </interface> 195</protocol> 196