aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Cezary Drożak <cezary@drozak.net>2023-06-16 11:28:30 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2023-06-16 15:30:04 +0200
commitc08762901e9840d8dca008dcc8d0b5602602fd0a (patch)
treeaa275ee79e2e356ffcd6ebcaf54c417dd47494a5 /sway/ipc-json.c
parentgamma_control_v1: handle destroyed output (diff)
downloadsway-c08762901e9840d8dca008dcc8d0b5602602fd0a.tar.gz
sway-c08762901e9840d8dca008dcc8d0b5602602fd0a.tar.zst
sway-c08762901e9840d8dca008dcc8d0b5602602fd0a.zip
input/libinput: add scroll_button_lock method
Closes https://github.com/swaywm/sway/issues/6987 Co-authored-by: JJGadgets <git@jjgadgets.tech> Co-authored-by: DeltaWhy <mike5713@gmail.com>
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index c7cbea01..58356d4e 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -1019,6 +1019,17 @@ static json_object *describe_libinput_device(struct libinput_device *device) {
1019 uint32_t button = libinput_device_config_scroll_get_button(device); 1019 uint32_t button = libinput_device_config_scroll_get_button(device);
1020 json_object_object_add(object, "scroll_button", 1020 json_object_object_add(object, "scroll_button",
1021 json_object_new_int(button)); 1021 json_object_new_int(button));
1022 const char *lock = "unknown";
1023 switch (libinput_device_config_scroll_get_button_lock(device)) {
1024 case LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED:
1025 lock = "enabled";
1026 break;
1027 case LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED:
1028 lock = "disabled";
1029 break;
1030 }
1031 json_object_object_add(object, "scroll_button_lock",
1032 json_object_new_string(lock));
1022 } 1033 }
1023 } 1034 }
1024 1035