git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

protocol/river-xkb-bindings-v1.xml (14.2K)

  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <protocol name="river_xkb_bindings_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="xkbcommon-based key bindings">
 27     This protocol allows the river-window-management-v1 window manager to
 28     define key bindings in terms of xkbcommon keysyms and other configurable
 29     properties.
 30 
 31     The key words "must", "must not", "required", "shall", "shall not",
 32     "should", "should not", "recommended", "may", and "optional" in this
 33     document are to be interpreted as described in IETF RFC 2119.
 34   </description>
 35 
 36   <interface name="river_xkb_bindings_v1" version="3">
 37     <description summary="xkbcommon bindings global interface">
 38       This global interface should only be advertised to the client if the
 39       river_window_manager_v1 global is also advertised.
 40     </description>
 41 
 42     <enum name="error" since="2">
 43       <entry name="object_already_created" value="0" since="2"/>
 44     </enum>
 45 
 46     <request name="destroy" type="destructor">
 47       <description summary="destroy the river_xkb_bindings_v1 object">
 48         This request indicates that the client will no longer use the
 49         river_xkb_bindings_v1 object.
 50       </description>
 51     </request>
 52 
 53     <request name="get_xkb_binding">
 54       <description summary="define a new xkbcommon key binding">
 55         Define a key binding for the given seat in terms of an xkbcommon keysym
 56         and other configurable properties.
 57 
 58         The new key binding is not enabled until initial configuration is
 59         completed and the enable request is made during a manage sequence.
 60       </description>
 61       <arg name="seat" type="object" interface="zcce_seat_v1"/>
 62       <arg name="id" type="new_id" interface="river_xkb_binding_v1"/>
 63       <arg name="keysym" type="uint" summary="an xkbcommon keysym"/>
 64       <arg name="modifiers" type="uint" enum="zcce_seat_v1.modifiers"/>
 65     </request>
 66 
 67     <request name="get_seat" since="2">
 68       <description summary="manage seat-specific state">
 69         Create an object to manage seat-specific xkb bindings state.
 70 
 71         It is a protocol error to make this request more than once for a given
 72         river_seat_v1 object.
 73       </description>
 74       <arg name="id" type="new_id" interface="river_xkb_bindings_seat_v1"/>
 75       <arg name="seat" type="object" interface="zcce_seat_v1"/>
 76     </request>
 77   </interface>
 78 
 79   <interface name="river_xkb_binding_v1" version="3">
 80     <description summary="configure a xkb key binding, receive trigger events">
 81       This object allows the window manager to configure a xkbcommon key binding
 82       and receive events when the key binding is triggered.
 83 
 84       The new key binding is not enabled until the enable request is made during
 85       a manage sequence.
 86 
 87       Normally, all key events are sent to the surface with keyboard focus by
 88       the compositor. Key events that trigger a key binding are not sent to the
 89       surface with keyboard focus.
 90 
 91       If multiple key bindings would be triggered by a single physical key event
 92       on the compositor side, it is compositor policy which key binding(s) will
 93       receive press/release events or if all of the matched key bindings receive
 94       press/release events.
 95 
 96       Key bindings might be matched by the same physical key event due to shared
 97       keysym and modifiers. The layout override feature may also cause the same
 98       physical key event to trigger two key bindings with different keysyms and
 99       different layout overrides configured.
100     </description>
101 
102     <request name="destroy" type="destructor">
103       <description summary="destroy the xkb binding object">
104         This request indicates that the client will no longer use the xkb key
105         binding object and that it may be safely destroyed.
106       </description>
107     </request>
108 
109     <request name="set_layout_override">
110       <description summary="override currently active xkb layout">
111         Specify an xkb layout that should be used to translate key events for
112         the purpose of triggering this key binding irrespective of the currently
113         active xkb layout.
114 
115         The layout argument is a 0-indexed xkbcommon layout number for the
116         keyboard that generated the key event.
117 
118         If this request is never made, the currently active xkb layout of the
119         keyboard that generated the key event will be used.
120 
121         This request modifies window management state and may only be made as
122         part of a manage sequence, see the river_window_manager_v1 description.
123       </description>
124       <arg name="layout" type="uint" summary="0-indexed xkbcommon layout"/>
125     </request>
126 
127     <request name="enable">
128       <description summary="enable the key binding">
129         This request should be made after all initial configuration has been
130         completed and the window manager wishes the key binding to be able to be
131         triggered.
132 
133         This request modifies window management state and may only be made as
134         part of a manage sequence, see the river_window_manager_v1 description.
135       </description>
136     </request>
137 
138     <request name="disable">
139       <description summary="disable the key binding">
140         This request may be used to temporarily disable the key binding. It may
141         be later re-enabled with the enable request.
142 
143         This request modifies window management state and may only be made as
144         part of a manage sequence, see the river_window_manager_v1 description.
145       </description>
146     </request>
147 
148     <event name="pressed">
149       <description summary="the key triggering the binding has been pressed">
150         This event indicates that the physical key triggering the binding has
151         been pressed.
152 
153         This event will be followed by a manage_start event after all other new
154         state has been sent by the server.
155 
156         The compositor should wait for the manage sequence to complete before
157         processing further input events. This allows the window manager client
158         to, for example, modify key bindings and keyboard focus without racing
159         against future input events. The window manager should of course respond
160         as soon as possible as the capacity of the compositor to buffer incoming
161         input events is finite.
162       </description>
163     </event>
164 
165     <event name="released">
166       <description summary="the key triggering the binding has been released">
167         This event indicates that the physical key triggering the binding has
168         been released.
169 
170         Releasing the modifiers for the binding without releasing the "main"
171         physical key that produces the bound keysym does not trigger the release
172         event. This event is sent when the "main" key is released, even if the
173         modifiers have changed since the pressed event.
174 
175         This event will be followed by a manage_start event after all other new
176         state has been sent by the server.
177 
178         The compositor should wait for the manage sequence to complete before
179         processing further input events. This allows the window manager client
180         to, for example, modify key bindings and keyboard focus without racing
181         against future input events. The window manager should of course respond
182         as soon as possible as the capacity of the compositor to buffer incoming
183         input events is finite.
184       </description>
185     </event>
186 
187     <event name="stop_repeat" since="2">
188       <description summary="repeating should be stopped">
189         This event indicates that repeating should be stopped for the binding if
190         the window manager has been repeating some action since the pressed
191         event.
192 
193         This event is generally sent when some other (possibly unbound) key is
194         pressed after the pressed event is sent and before the released event
195         is sent for this binding.
196 
197         This event will be followed by a manage_start event after all other new
198         state has been sent by the server.
199       </description>
200     </event>
201   </interface>
202 
203   <interface name="river_xkb_bindings_seat_v1" version="3">
204     <description summary="xkb bindings seat">
205       This object manages xkb bindings state associated with a specific seat.
206     </description>
207 
208     <request name="destroy" type="destructor" since="2">
209       <description summary="destroy the object">
210         This request indicates that the client will no longer use the object and
211         that it may be safely destroyed.
212       </description>
213     </request>
214 
215     <request name="ensure_next_key_eaten" since="2">
216       <description summary="ensure the next key press event is eaten">
217         Ensure that the next non-modifier key press and corresponding release
218         events for this seat are not sent to the currently focused surface.
219 
220         If the next non-modifier key press triggers a binding, the
221         pressed/released events are sent to the river_xkb_binding_v1 object as
222         usual.
223 
224         If the next non-modifier key press does not trigger a binding, the
225         ate_unbound_key event is sent instead.
226 
227         Rationale: the window manager may wish to implement "chorded"
228         keybindings where triggering a binding activates a "submap" with a
229         different set of keybindings. Without a way to eat the next key
230         press event, there is no good way for the window manager to know that it
231         should error out and exit the submap when a key not bound in the submap
232         is pressed.
233 
234         This request modifies window management state and may only be made as
235         part of a manage sequence, see the river_window_manager_v1 description.
236       </description>
237     </request>
238 
239     <request name="cancel_ensure_next_key_eaten" since="2">
240       <description summary="cancel an ensure_next_key_eaten request">
241         This requests cancels the effect of the latest ensure_next_key_eaten
242         request if no key has been eaten due to the request yet. This request
243         has no effect if a key has already been eaten or no
244         ensure_next_key_eaten was made.
245 
246         Rationale: the window manager may wish cancel an uncompleted "chorded"
247         keybinding after a timeout of a few seconds. Note that since this
248         timeout use-case requires the window manager to trigger a manage sequence
249         with the river_window_manager_v1.manage_dirty request it is possible that
250         the ate_unbound_key key event may be sent before the window manager has
251         a chance to make the cancel_ensure_next_key_eaten request.
252 
253         This request modifies window management state and may only be made as
254         part of a manage sequence, see the river_window_manager_v1 description.
255       </description>
256     </request>
257 
258     <event name="ate_unbound_key" since="2">
259       <description summary="an unbound key press event was eaten">
260         An unbound key press event was eaten due to the ensure_next_key_eaten
261         request.
262 
263         This event will be followed by a manage_start event after all other new
264         state has been sent by the server.
265       </description>
266     </event>
267 
268     <request name="modifiers_watch" since="3">
269       <description summary="watch for change in active modifiers">
270         Request that the server send the modifiers_update event whenever a state
271         change occurs for at least one of the modifiers specified by the
272         modifiers argument.
273 
274         The window manager should make this request with the modifiers argument
275         set to 0 when it no longer wishes to take action based on a change in
276         modifiers.
277 
278         This request modifies window management state and may only be made as
279         part of a manage sequence, see the river_window_manager_v1 description.
280       </description>
281       <arg name="modifiers" type="uint" enum="river_seat_v1.modifiers"/>
282     </request>
283 
284     <event name="modifiers_update" since="3">
285       <description summary="active modifiers for the seat changed">
286         The set of currently active modifiers for the seat changed. This event
287         is only sent when there is a change in state for modifiers marked as
288         watched using the modifiers_watch request.
289 
290         The old and new arguments convey the set of modifiers active before and
291         after the change. All modifiers are included in the old and new
292         arguments, including modifiers that are not watched.
293 
294         Since this event is only sent when there is a change in state for
295         watched modifiers, it follows that at least one watched modifier is
296         active in old but inactive in new or vice-versa.
297 
298         This event will be followed by a manage_start event after all other new
299         state has been sent by the server.
300 
301         The compositor should wait for the manage sequence to complete before
302         processing further input events. This allows the window manager client
303         to, for example, modify key bindings and keyboard focus without racing
304         against future input events. The window manager should of course respond
305         as soon as possible as the capacity of the compositor to buffer incoming
306         input events is finite.
307       </description>
308       <arg name="old" type="uint" enum="river_seat_v1.modifiers"
309         summary="previously active modifiers"/>
310       <arg name="new" type="uint" enum="river_seat_v1.modifiers"
311         summary="currently active modifiers"/>
312     </event>
313   </interface>
314 </protocol>