mirror of
https://github.com/swaywm/sway.git
synced 2026-03-29 07:58:16 -04:00
Add support for keypad slide switches
See the libinput docs: https://wayland.freedesktop.org/libinput/doc/latest/api/group__device.html#gga507e97278f2eb7d2271023ef2a3d31a4aed050386a5b52b2b51d05d95bb594c30
This commit is contained in:
parent
438010938c
commit
fa497964fd
3 changed files with 11 additions and 6 deletions
|
|
@ -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_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
|
||||||
conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
|
conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
|
||||||
conf_data.set10('HAVE_TRAY', have_tray)
|
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))
|
conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: libinput))
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -543,6 +543,10 @@ struct cmd_results *cmd_bind_or_unbind_switch(int argc, char **argv,
|
||||||
binding->type = WLR_SWITCH_TYPE_TABLET_MODE;
|
binding->type = WLR_SWITCH_TYPE_TABLET_MODE;
|
||||||
} else if (strcmp(split->items[0], "lid") == 0) {
|
} else if (strcmp(split->items[0], "lid") == 0) {
|
||||||
binding->type = WLR_SWITCH_TYPE_LID;
|
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 {
|
} else {
|
||||||
free_switch_binding(binding);
|
free_switch_binding(binding);
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
|
|
|
||||||
|
|
@ -506,11 +506,12 @@ runtime.
|
||||||
|
|
||||||
*bindswitch* [--locked] [--no-warn] [--reload] <switch>:<state> <command>
|
*bindswitch* [--locked] [--no-warn] [--reload] <switch>:<state> <command>
|
||||||
Binds <switch> to execute the sway command _command_ on state changes.
|
Binds <switch> to execute the sway command _command_ on state changes.
|
||||||
Supported switches are _lid_ (laptop lid) and _tablet_ (tablet mode)
|
Supported switches are _lid_ (laptop lid), _tablet_ (tablet mode) and
|
||||||
switches. Valid values for _state_ are _on_, _off_ and _toggle_. These
|
_keypad_slide_ (whether the device keypad is exposed or not) switches. Valid
|
||||||
switches are on when the device lid is shut and when tablet mode is active
|
values for _state_ are _on_, _off_ and _toggle_. These switches are on when
|
||||||
respectively. _toggle_ is also supported to run a command both when the
|
the device lid is shut, when tablet mode is active and when the keypad is
|
||||||
switch is toggled on or off.
|
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
|
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
|
screen locking program is active. If there is a matching binding with
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue