diff options
author | 2020-02-16 00:40:18 +0100 | |
---|---|---|
committer | 2020-03-11 23:51:37 -0400 | |
commit | 3ee5aace33f1b5673ab372afba38480338ba8b90 (patch) | |
tree | a91724f17a916a6075c71f555968fa046973fddd /include/sway | |
parent | input: Add support for keyboard shortcuts inhibit (diff) | |
download | sway-3ee5aace33f1b5673ab372afba38480338ba8b90.tar.gz sway-3ee5aace33f1b5673ab372afba38480338ba8b90.tar.zst sway-3ee5aace33f1b5673ab372afba38480338ba8b90.zip |
commands: Add shortcuts_inhibitor command
Add a command to influence keyboard shortcuts inhibitors. In its current
form it can be used to activate, deactivate or toggle an existing
inhibitor on the surface currently receiving input. This can be used to
define an escape shortcut such as:
bindsym --inhibited $mod+Escape seat - shortcuts_inhibitor deactivate
It also allows the user to configure a per-seat default of whether
keyboard inhibitors are honoured by default (the default) or not. Using
the activate/toggle command they can then enable the lingering inhibitor
at a later time of their choosing.
As a side effect this allows to specifically address a named seat for
actions as well, whatever use-case that might serve.
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/commands.h | 1 | ||||
-rw-r--r-- | include/sway/config.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index bbbdfc80..3fde0893 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -288,6 +288,7 @@ sway_cmd seat_cmd_idle_inhibit; | |||
288 | sway_cmd seat_cmd_idle_wake; | 288 | sway_cmd seat_cmd_idle_wake; |
289 | sway_cmd seat_cmd_keyboard_grouping; | 289 | sway_cmd seat_cmd_keyboard_grouping; |
290 | sway_cmd seat_cmd_pointer_constraint; | 290 | sway_cmd seat_cmd_pointer_constraint; |
291 | sway_cmd seat_cmd_shortcuts_inhibitor; | ||
291 | sway_cmd seat_cmd_xcursor_theme; | 292 | sway_cmd seat_cmd_xcursor_theme; |
292 | 293 | ||
293 | sway_cmd cmd_ipc_cmd; | 294 | sway_cmd cmd_ipc_cmd; |
diff --git a/include/sway/config.h b/include/sway/config.h index fdd65efd..359f9604 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -177,6 +177,12 @@ enum seat_config_allow_constrain { | |||
177 | CONSTRAIN_DISABLE | 177 | CONSTRAIN_DISABLE |
178 | }; | 178 | }; |
179 | 179 | ||
180 | enum seat_config_shortcuts_inhibit { | ||
181 | SHORTCUTS_INHIBIT_DEFAULT, // the default is currently enabled | ||
182 | SHORTCUTS_INHIBIT_ENABLE, | ||
183 | SHORTCUTS_INHIBIT_DISABLE | ||
184 | }; | ||
185 | |||
180 | enum seat_keyboard_grouping { | 186 | enum seat_keyboard_grouping { |
181 | KEYBOARD_GROUP_DEFAULT, // the default is currently smart | 187 | KEYBOARD_GROUP_DEFAULT, // the default is currently smart |
182 | KEYBOARD_GROUP_NONE, | 188 | KEYBOARD_GROUP_NONE, |
@@ -201,6 +207,7 @@ struct seat_config { | |||
201 | list_t *attachments; // list of seat_attachment configs | 207 | list_t *attachments; // list of seat_attachment configs |
202 | int hide_cursor_timeout; | 208 | int hide_cursor_timeout; |
203 | enum seat_config_allow_constrain allow_constrain; | 209 | enum seat_config_allow_constrain allow_constrain; |
210 | enum seat_config_shortcuts_inhibit shortcuts_inhibit; | ||
204 | enum seat_keyboard_grouping keyboard_grouping; | 211 | enum seat_keyboard_grouping keyboard_grouping; |
205 | uint32_t idle_inhibit_sources, idle_wake_sources; | 212 | uint32_t idle_inhibit_sources, idle_wake_sources; |
206 | struct { | 213 | struct { |