Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
protocol/river-input-management-v1.xml (9.6K)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="river_input_management_v1">
3 <copyright>
4 SPDX-FileCopyrightText: © 2025 Isaac Freund
5 SPDX-License-Identifier: MIT
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to
9 deal in the Software without restriction, including without limitation the
10 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23 IN THE SOFTWARE.
24 </copyright>
25
26 <description summary="manage seats and input devices">
27 This protocol supports creating/destroying seats, assigning input devices to
28 seats, and configuring input devices (e.g. setting keyboard repeat rate).
29
30 The key words "must", "must not", "required", "shall", "shall not",
31 "should", "should not", "recommended", "may", and "optional" in this
32 document are to be interpreted as described in IETF RFC 2119.
33 </description>
34
35 <interface name="river_input_manager_v1" version="2">
36 <description summary="input manager global interface">
37 Input manager global interface.
38 </description>
39
40 <enum name="error">
41 <entry name="invalid_destroy" value="0"/>
42 </enum>
43
44 <request name="stop">
45 <description summary="stop sending events">
46 This request indicates that the client no longer wishes to receive
47 events on this object.
48
49 The Wayland protocol is asynchronous, which means the server may send
50 further events until the stop request is processed. The client must wait
51 for a river_input_manager_v1.finished event before destroying this
52 object.
53 </description>
54 </request>
55
56 <event name="finished">
57 <description summary="the server has finished with the input manager">
58 This event indicates that the server will send no further events on this
59 object. The client should destroy the object. See
60 river_input_manager_v1.destroy for more information.
61 </description>
62 </event>
63
64 <request name="destroy" type="destructor">
65 <description summary="destroy the river_input_manager_v1 object">
66 This request should be called after the finished event has been received
67 to complete destruction of the object.
68
69 It is a protocol error to make this request before the finished event
70 has been received.
71
72 If a client wishes to destroy this object it should send a
73 river_input_manager_v1.stop request and wait for a
74 river_input_manager_v1.finished event. Once the finished event is
75 received it is safe to destroy this object and any other objects created
76 through this interface.
77 </description>
78 </request>
79
80 <request name="create_seat">
81 <description summary="create a new seat">
82 Create a new seat with the given name. Has no effect if a seat with the
83 given name already exists.
84
85 The default seat with name "default" always exists and does not need to
86 be explicitly created.
87 </description>
88 <arg name="name" type="string"/>
89 </request>
90
91 <request name="destroy_seat">
92 <description summary="destroy a seat">
93 Destroy the seat with the given name. Has no effect if a seat with the
94 given name does not exist.
95
96 The default seat with name "default" cannot be destroyed and attempting
97 to destroy it will have no effect.
98
99 Any input devices assigned to the destroyed seat at the time of
100 destruction are assigned to the default seat.
101 </description>
102 <arg name="name" type="string"/>
103 </request>
104
105 <event name="input_device">
106 <description summary="new input device">
107 A new input device has been created.
108 </description>
109 <arg name="id" type="new_id" interface="river_input_device_v1"/>
110 </event>
111 </interface>
112
113 <interface name="river_input_device_v1" version="2">
114 <description summary="an input device">
115 An input device represents a physical keyboard, mouse, touchscreen, or
116 drawing tablet tool. It is assigned to exactly one seat at a time.
117 By default, all input devices are assigned to the default seat.
118 </description>
119
120 <enum name="error">
121 <entry name="invalid_repeat_info" value="0"/>
122 <entry name="invalid_scroll_factor" value="1"/>
123 <entry name="invalid_map_to_rectangle" value="2"/>
124 </enum>
125
126 <request name="destroy" type="destructor">
127 <description summary="destroy the input device object">
128 This request indicates that the client will no longer use the input
129 device object and that it may be safely destroyed.
130 </description>
131 </request>
132
133 <event name="removed">
134 <description summary="the input device is removed">
135 This event indicates that the input device has been removed.
136
137 The server will send no further events on this object and ignore any
138 request (other than river_input_device_v1.destroy) made after this event is
139 sent. The client should destroy this object with the
140 river_input_device_v1.destroy request to free up resources.
141 </description>
142 </event>
143
144 <enum name="type">
145 <entry name="keyboard" value="0"/>
146 <entry name="pointer" value="1"/>
147 <entry name="touch" value="2"/>
148 <entry name="tablet" value="3"/>
149 </enum>
150
151 <event name="type">
152 <description summary="the type of the input device">
153 The type of the input device. This event is sent once when the
154 river_input_device_v1 object is created. The device type cannot
155 change during the lifetime of the object.
156 </description>
157 <arg name="type" type="uint" enum="type"/>
158 </event>
159
160 <event name="name">
161 <description summary="the name of the input device">
162 The name of the input device. This event is sent once when the
163 river_input_device_v1 object is created. The device name cannot
164 change during the lifetime of the object.
165 </description>
166 <arg name="name" type="string"/>
167 </event>
168
169 <request name="assign_to_seat">
170 <description summary="assign the input device to a seat">
171 Assign the input device to a seat. All input devices not explicitly
172 assigned to a seat are considered assigned to the default seat.
173
174 Has no effect if a seat with the given name does not exist.
175 </description>
176 <arg name="name" type="string" summary="name of the seat"/>
177 </request>
178
179 <request name="set_repeat_info">
180 <description summary="set keyboard repeat rate and delay">
181 Set repeat rate and delay for a keyboard input device. Has no effect if
182 the device is not a keyboard.
183
184 Negative values for either rate or delay are illegal. A rate of zero
185 will disable any repeating (regardless of the value of delay).
186 </description>
187 <arg name="rate" type="int" summary="rate in key repeats per second"/>
188 <arg name="delay" type="int" summary="delay in milliseconds"/>
189 </request>
190
191 <request name="set_scroll_factor">
192 <description summary="set scroll factor">
193 Set the scroll factor for a pointer input device. Has no effect if the
194 device is not a pointer.
195
196 For example, a factor of 0.5 will make scrolling twice as slow while a
197 factor of 3.0 will make scrolling 3 times as fast.
198
199 Setting a scroll factor less than 0 is a protocol error.
200 </description>
201 <arg name="factor" type="fixed"/>
202 </request>
203
204 <request name="map_to_output">
205 <description summary="map input device to the given output">
206 Map the input device to the given output. Has no effect if the device is
207 not a pointer, touch, or tablet device.
208
209 If mapped to both an output and a rectangle, the rectangle has priority.
210
211 Passing null clears an existing mapping.
212 </description>
213 <arg name="output" type="object" interface="wl_output" allow-null="true"/>
214 </request>
215
216 <request name="map_to_rectangle">
217 <description summary="map input device to the given rectangle">
218 Map the input device to the given rectangle in the global compositor
219 coordinate space. Has no effect if the device is not a pointer, touch,
220 or tablet device.
221
222 If mapped to both an output and a rectangle, the rectangle has priority.
223
224 Width and height must be greater than or equal to 0.
225
226 Passing 0 for width or height clears an existing mapping.
227 </description>
228 <arg name="x" type="int"/>
229 <arg name="y" type="int"/>
230 <arg name="width" type="int"/>
231 <arg name="height" type="int"/>
232 </request>
233
234 <event name="done" since="2">
235 <description summary="all information has been sent">
236 This event is sent after all information about the input device has
237 been sent.
238
239 This allows changes to one or more river_input_device_v1 properties to
240 be seen as atomic, even if they happen via multiple events.
241 </description>
242 </event>
243 </interface>
244 </protocol>