diff options
author | Ryan Walklin <ryan@testtoast.com> | 2019-03-20 14:47:29 +1100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2019-03-19 23:58:47 -0400 |
commit | bdb402404cd6d54242b0b1dc2360cfc5679e52f2 (patch) | |
tree | 5a355e025c24b3de0bc69db4b8cc9d002bbd1167 /sway/ipc-json.c | |
parent | Clean up focus follows mouse logic (diff) | |
download | sway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.tar.gz sway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.tar.zst sway-bdb402404cd6d54242b0b1dc2360cfc5679e52f2.zip |
Support WLR_INPUT_DEVICE_SWITCH in sway
This commit adds support for laptop lid and tablet
mode switches as provided by evdev/libinput and
handled by wlroots.
Adds a new bindswitch command with syntax:
bindswitch <switch>:<state> <command>
Where <switch> is one of:
tablet for WLR_SWITCH_TYPE_TABLET_MODE
lid for WLR_SWITCH_TYPE_LID
<state> is one of:
on for WLR_SWITCH_STATE_ON
off for WLR_SWITCH_STATE_OFF
toggle for WLR_SWITCH_STATE_TOGGLE
(Note that WLR_SWITCH_STATE_TOGGLE doesn't map to
libinput and will trigger at both on and off events)
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index f61e1a8c..c320d958 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -91,14 +91,14 @@ static const char *ipc_json_device_type_description(struct sway_input_device *de | |||
91 | return "pointer"; | 91 | return "pointer"; |
92 | case WLR_INPUT_DEVICE_KEYBOARD: | 92 | case WLR_INPUT_DEVICE_KEYBOARD: |
93 | return "keyboard"; | 93 | return "keyboard"; |
94 | case WLR_INPUT_DEVICE_SWITCH: | ||
95 | return "switch"; | ||
94 | case WLR_INPUT_DEVICE_TOUCH: | 96 | case WLR_INPUT_DEVICE_TOUCH: |
95 | return "touch"; | 97 | return "touch"; |
96 | case WLR_INPUT_DEVICE_TABLET_TOOL: | 98 | case WLR_INPUT_DEVICE_TABLET_TOOL: |
97 | return "tablet_tool"; | 99 | return "tablet_tool"; |
98 | case WLR_INPUT_DEVICE_TABLET_PAD: | 100 | case WLR_INPUT_DEVICE_TABLET_PAD: |
99 | return "tablet_pad"; | 101 | return "tablet_pad"; |
100 | case WLR_INPUT_DEVICE_SWITCH: | ||
101 | return "switch"; | ||
102 | } | 102 | } |
103 | return "unknown"; | 103 | return "unknown"; |
104 | } | 104 | } |