aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-01-13 20:35:45 -0500
committerLibravatar GitHub <noreply@github.com>2019-01-13 20:35:45 -0500
commit4eb0767414fe404adf1c0b0be7c719f5ac115684 (patch)
tree472e620249f29c62e50df28faa36c3223d3d1fe4 /sway/ipc-json.c
parentMerge pull request #3408 from RedSoxFan/bar-padding (diff)
parentget_inputs: add libinput send events mode (diff)
downloadsway-4eb0767414fe404adf1c0b0be7c719f5ac115684.tar.gz
sway-4eb0767414fe404adf1c0b0be7c719f5ac115684.tar.zst
sway-4eb0767414fe404adf1c0b0be7c719f5ac115684.zip
Merge pull request #3398 from RedSoxFan/toggle-input-events
input events: toggle and ipc get_inputs
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 09b65e8d..15f89f65 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -11,6 +11,7 @@
11#include "sway/output.h" 11#include "sway/output.h"
12#include "sway/input/input-manager.h" 12#include "sway/input/input-manager.h"
13#include "sway/input/seat.h" 13#include "sway/input/seat.h"
14#include <wlr/backend/libinput.h>
14#include <wlr/types/wlr_box.h> 15#include <wlr/types/wlr_box.h>
15#include <wlr/types/wlr_output.h> 16#include <wlr/types/wlr_output.h>
16#include <xkbcommon/xkbcommon.h> 17#include <xkbcommon/xkbcommon.h>
@@ -598,6 +599,26 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
598 } 599 }
599 } 600 }
600 601
602 if (wlr_input_device_is_libinput(device->wlr_device)) {
603 struct libinput_device *libinput_dev;
604 libinput_dev = wlr_libinput_get_device_handle(device->wlr_device);
605
606 const char *events = "unknown";
607 switch (libinput_device_config_send_events_get_mode(libinput_dev)) {
608 case LIBINPUT_CONFIG_SEND_EVENTS_ENABLED:
609 events = "enabled";
610 break;
611 case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE:
612 events = "disabled_on_external_mouse";
613 break;
614 case LIBINPUT_CONFIG_SEND_EVENTS_DISABLED:
615 events = "disabled";
616 break;
617 }
618 json_object_object_add(object, "libinput_send_events",
619 json_object_new_string(events));
620 }
621
601 return object; 622 return object;
602} 623}
603 624