|
28 | 28 | hotkeys: it describes a trigger and the compositor accepts it or rejects it |
29 | 29 | with a reason. A hotkey fires regardless of which surface holds keyboard |
30 | 30 | 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. |
32 | 32 |
|
33 | 33 | The key words "must", "must not", "required", "shall", "shall not", |
34 | 34 | "should", "should not", "recommended", "may", and "optional" in this |
|
45 | 45 | may grant the same trigger to several bindings, in which case each bound |
46 | 46 | hotkey receives the events. Clients must cope with either. |
47 | 47 |
|
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 | | - |
53 | 48 | Security considerations: |
54 | 49 |
|
55 | 50 | A global hotkey lets an unfocused client observe that a specific trigger |
|
80 | 75 | The protocol's one hard guarantee is containment: a compositor must not |
81 | 76 | deliver events for a trigger the client did not successfully bind, and never |
82 | 77 | 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. |
83 | 83 | </description> |
84 | 84 |
|
85 | 85 | <interface name="xx_hotkey_manager_v1" version="1"> |
|
98 | 98 | <enum name="modifiers" bitfield="true"> |
99 | 99 | <description summary="modifier keys required by a trigger"> |
100 | 100 | 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. |
101 | 104 |
|
102 | 105 | These are fixed, keymap-independent semantic bits. A compositor matches |
103 | 106 | each bit against the corresponding modifier in its keyboard state as the |
|
171 | 174 | compositor is reported through "denied" and is not an error. |
172 | 175 | </description> |
173 | 176 | <entry name="invalid_trigger" value="0" |
174 | | - summary="a null keysym"/> |
| 177 | + summary="a null keysym, or unknown modifier bits"/> |
175 | 178 | <entry name="no_trigger" value="1" |
176 | 179 | summary="commit was sent before any trigger was described"/> |
177 | 180 | </enum> |
|
183 | 186 | may describe a different trigger and commit again. |
184 | 187 |
|
185 | 188 | 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. |
188 | 190 | </description> |
189 | 191 | <entry name="already_bound" value="0" |
190 | 192 | summary="held by another hotkey the compositor treats as exclusive"/> |
|
212 | 214 | <description summary="restrict the hotkey to one seat"> |
213 | 215 | Restrict the hotkey to the given seat, or pass null for all of the |
214 | 216 | client's seats, virtual ones included. Optional; the default is null. |
| 217 | + If the given seat is removed, the compositor sends "revoked". |
215 | 218 | </description> |
216 | 219 | <arg name="seat" type="object" interface="wl_seat" allow-null="true" |
217 | 220 | summary="target seat, or null for all of the client's seats"/> |
|
225 | 228 |
|
226 | 229 | The keysym uses the numbering shared with the keymap delivered over |
227 | 230 | 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. |
231 | 238 |
|
232 | 239 | 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. |
235 | 242 |
|
236 | 243 | The keysym may be one that contributes to modifier state, such as |
237 | 244 | XKB_KEY_Super_L; whether it does is decided by the seat's keymap. Such a |
|
262 | 269 |
|
263 | 270 | The button is a button code in the same space as wl_pointer.button. |
264 | 271 |
|
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. |
267 | 274 | </description> |
268 | 275 | <arg name="button" type="uint" summary="button code, as in wl_pointer.button"/> |
269 | 276 | <arg name="modifiers" type="uint" enum="xx_hotkey_manager_v1.modifiers" |
|
279 | 286 | "no_trigger" error. |
280 | 287 |
|
281 | 288 | 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. |
285 | 295 | </description> |
286 | 296 | </request> |
287 | 297 |
|
|
337 | 347 |
|
338 | 348 | <event name="released"> |
339 | 349 | <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. |
343 | 354 |
|
344 | 355 | serial and time have the same meaning as in the "triggered" event. |
345 | 356 | </description> |
|
0 commit comments