From 3ee5aace33f1b5673ab372afba38480338ba8b90 Mon Sep 17 00:00:00 2001 From: Michael Weiser Date: Sun, 16 Feb 2020 00:40:18 +0100 Subject: 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 --- sway/config/seat.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sway/config') diff --git a/sway/config/seat.c b/sway/config/seat.c index 6c916727..e2702de5 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c @@ -30,6 +30,7 @@ struct seat_config *new_seat_config(const char* name) { } seat->hide_cursor_timeout = -1; seat->allow_constrain = CONSTRAIN_DEFAULT; + seat->shortcuts_inhibit = SHORTCUTS_INHIBIT_DEFAULT; seat->keyboard_grouping = KEYBOARD_GROUP_DEFAULT; seat->xcursor_theme.name = NULL; seat->xcursor_theme.size = 24; @@ -154,6 +155,10 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) { dest->allow_constrain = source->allow_constrain; } + if (source->shortcuts_inhibit != SHORTCUTS_INHIBIT_DEFAULT) { + dest->shortcuts_inhibit = source->shortcuts_inhibit; + } + if (source->keyboard_grouping != KEYBOARD_GROUP_DEFAULT) { dest->keyboard_grouping = source->keyboard_grouping; } -- cgit v1.2.3