Skip to content

Commit a759ff0

Browse files
committed
xx-hotkey-v1: wording
1 parent 2161a74 commit a759ff0

1 file changed

Lines changed: 33 additions & 22 deletions

File tree

‎experimental/xx-hotkey/xx-hotkey-v1.xml‎

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
hotkeys: it describes a trigger and the compositor accepts it or rejects it
2929
with a reason. A hotkey fires regardless of which surface holds keyboard
3030
focus. The compositor remains the arbiter and may deny a commit or revoke a
31-
binding at any time.
31+
binding at any time, but the client chooses the trigger.
3232

3333
The key words "must", "must not", "required", "shall", "shall not",
3434
"should", "should not", "recommended", "may", and "optional" in this
@@ -45,11 +45,6 @@
4545
may grant the same trigger to several bindings, in which case each bound
4646
hotkey receives the events. Clients must cope with either.
4747

48-
Warning! The protocol described in this file is currently in the
49-
experimental phase. Backwards incompatible major versions of the protocol
50-
are to be expected. Exposing this protocol without an opt-in mechanism is
51-
discouraged.
52-
5348
Security considerations:
5449

5550
A global hotkey lets an unfocused client observe that a specific trigger
@@ -80,6 +75,11 @@
8075
The protocol's one hard guarantee is containment: a compositor must not
8176
deliver events for a trigger the client did not successfully bind, and never
8277
forwards the raw input stream.
78+
79+
Warning! The protocol described in this file is currently in the
80+
experimental phase. Backwards incompatible major versions of the protocol
81+
are to be expected. Exposing this protocol without an opt-in mechanism is
82+
discouraged.
8383
</description>
8484

8585
<interface name="xx_hotkey_manager_v1" version="1">
@@ -98,6 +98,9 @@
9898
<enum name="modifiers" bitfield="true">
9999
<description summary="modifier keys required by a trigger">
100100
A bitmask of the modifiers that must be held for the trigger to fire.
101+
The match is exact: a trigger does not fire while a modifier outside
102+
its mask is held, so Super+Space does not fire on Super+Shift+Space.
103+
Bits outside this enum raise the "invalid_trigger" error.
101104

102105
These are fixed, keymap-independent semantic bits. A compositor matches
103106
each bit against the corresponding modifier in its keyboard state as the
@@ -171,7 +174,7 @@
171174
compositor is reported through "denied" and is not an error.
172175
</description>
173176
<entry name="invalid_trigger" value="0"
174-
summary="a null keysym"/>
177+
summary="a null keysym, or unknown modifier bits"/>
175178
<entry name="no_trigger" value="1"
176179
summary="commit was sent before any trigger was described"/>
177180
</enum>
@@ -183,8 +186,7 @@
183186
may describe a different trigger and commit again.
184187

185188
A compositor is not obliged to distinguish "already_bound" from
186-
"not_permitted" and may report the latter for both. A client that
187-
receives an unrecognised value must treat it as "not_permitted".
189+
"not_permitted" and may report the latter for both.
188190
</description>
189191
<entry name="already_bound" value="0"
190192
summary="held by another hotkey the compositor treats as exclusive"/>
@@ -212,6 +214,7 @@
212214
<description summary="restrict the hotkey to one seat">
213215
Restrict the hotkey to the given seat, or pass null for all of the
214216
client's seats, virtual ones included. Optional; the default is null.
217+
If the given seat is removed, the compositor sends "revoked".
215218
</description>
216219
<arg name="seat" type="object" interface="wl_seat" allow-null="true"
217220
summary="target seat, or null for all of the client's seats"/>
@@ -225,13 +228,17 @@
225228

226229
The keysym uses the numbering shared with the keymap delivered over
227230
wl_keyboard (for the xkb_v1 keymap format, an XKB_KEY_* value), in its
228-
unshifted form (XKB_KEY_b, not XKB_KEY_B). A compositor should match it
229-
against any of the user's layout groups, so that a binding keeps firing
230-
after a layout group switch.
231+
unshifted form (XKB_KEY_b, not XKB_KEY_B). The compositor matches it
232+
against the keysym each key produces at its first shift level in any of
233+
the user's layout groups, ignoring the effect Shift has on the key, so
234+
that Shift is handled through the modifier mask like every other
235+
modifier and a binding keeps firing after a layout group switch. A
236+
binding whose keysym no group of the current keymap produces stays
237+
bound and simply does not fire until the keymap changes again.
231238

232239
The trigger fires on key press; the compositor does not wait to see
233-
whether another key follows. The press is consumed and must not be
234-
delivered to the focused surface.
240+
whether another key follows. The press and the matching release are
241+
consumed and must not be delivered to the focused surface.
235242

236243
The keysym may be one that contributes to modifier state, such as
237244
XKB_KEY_Super_L; whether it does is decided by the seat's keymap. Such a
@@ -262,8 +269,8 @@
262269

263270
The button is a button code in the same space as wl_pointer.button.
264271

265-
The press is consumed and must not be delivered to the surface under the
266-
pointer.
272+
The press and the matching release are consumed and must not be
273+
delivered to the surface under the pointer.
267274
</description>
268275
<arg name="button" type="uint" summary="button code, as in wl_pointer.button"/>
269276
<arg name="modifiers" type="uint" enum="xx_hotkey_manager_v1.modifiers"
@@ -279,9 +286,12 @@
279286
"no_trigger" error.
280287

281288
Commit may be sent again to apply a changed trigger, description or
282-
seat, keeping the binding's identity. An established binding survives a
283-
rejected commit: the previous state stays active, so a denied
284-
reconfiguration never leaves the user with no hotkey.
289+
seat, keeping the binding's identity. Values set with set_* requests are
290+
retained across commits, accepted or denied, and each commit applies
291+
all of them; committing with nothing changed is accepted with "bound".
292+
An established binding survives a rejected commit: the previous state
293+
stays active, so a denied reconfiguration never leaves the user with no
294+
hotkey.
285295
</description>
286296
</request>
287297

@@ -337,9 +347,10 @@
337347

338348
<event name="released">
339349
<description summary="the hotkey was released">
340-
The trigger of a previously triggered hotkey was released. This enables
341-
press-and-hold uses such as push-to-talk; clients that only act on
342-
the initial firing may ignore it.
350+
The key or button of a previously triggered hotkey was released,
351+
regardless of modifier state. This enables press-and-hold uses such as
352+
push-to-talk; clients that only act on the initial firing may ignore
353+
it.
343354

344355
serial and time have the same meaning as in the "triggered" event.
345356
</description>

0 commit comments

Comments
 (0)