From bdb402404cd6d54242b0b1dc2360cfc5679e52f2 Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Wed, 20 Mar 2019 14:47:29 +1100 Subject: 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 : Where is one of: tablet for WLR_SWITCH_TYPE_TABLET_MODE lid for WLR_SWITCH_TYPE_LID 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) --- sway/ipc-json.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/ipc-json.c') 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 return "pointer"; case WLR_INPUT_DEVICE_KEYBOARD: return "keyboard"; + case WLR_INPUT_DEVICE_SWITCH: + return "switch"; case WLR_INPUT_DEVICE_TOUCH: return "touch"; case WLR_INPUT_DEVICE_TABLET_TOOL: return "tablet_tool"; case WLR_INPUT_DEVICE_TABLET_PAD: return "tablet_pad"; - case WLR_INPUT_DEVICE_SWITCH: - return "switch"; } return "unknown"; } -- cgit v1.2.3-54-g00ecf