aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build2
-rw-r--r--sway/commands/bind.c4
-rw-r--r--sway/sway.5.scd11
3 files changed, 11 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index de5a620c..974a4071 100644
--- a/meson.build
+++ b/meson.build
@@ -110,7 +110,7 @@ conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd
conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
conf_data.set10('HAVE_TRAY', have_tray)
-foreach sym : ['LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', 'LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY']
+foreach sym : ['LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', 'LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY', 'LIBINPUT_SWITCH_KEYPAD_SLIDE']
conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: libinput))
endforeach
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 15373d5a..627d994a 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -543,6 +543,10 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
binding->type = WLR_SWITCH_TYPE_TABLET_MODE;
} else if (strcmp(split->items[0], "lid") == 0) {
binding->type = WLR_SWITCH_TYPE_LID;
+#if HAVE_LIBINPUT_SWITCH_KEYPAD_SLIDE
+ } else if (strcmp(split->items[0], "keypad_slide") == 0) {
+ binding->type = WLR_SWITCH_TYPE_KEYPAD_SLIDE;
+#endif
} else {
free_switch_binding(binding);
return cmd_results_new(CMD_FAILURE,
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index 53393bcc..952d243d 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -506,11 +506,12 @@ runtime.
*bindswitch* [--locked] [--no-warn] [--reload] <switch>:<state> <command>
Binds <switch> to execute the sway command _command_ on state changes.
- Supported switches are _lid_ (laptop lid) and _tablet_ (tablet mode)
- switches. Valid values for _state_ are _on_, _off_ and _toggle_. These
- switches are on when the device lid is shut and when tablet mode is active
- respectively. _toggle_ is also supported to run a command both when the
- switch is toggled on or off.
+ Supported switches are _lid_ (laptop lid), _tablet_ (tablet mode) and
+ _keypad_slide_ (whether the device keypad is exposed or not) switches. Valid
+ values for _state_ are _on_, _off_ and _toggle_. These switches are on when
+ the device lid is shut, when tablet mode is active and when the keypad is
+ exposed respectively. _toggle_ is also supported to run a command both when
+ the switch is toggled on or off.
Unless the flag _--locked_ is set, the command will not be run when a
screen locking program is active. If there is a matching binding with