aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/ipc-json.c21
-rw-r--r--swaymsg/main.c6
2 files changed, 26 insertions, 1 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 53e0e335..19930319 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
diff --git a/swaymsg/main.c b/swaymsg/main.c
index f1bb5e3e..e5eee631 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -113,7 +113,7 @@ static const char *pretty_type_name(const char *name) {
113} 113}
114 114
115static void pretty_print_input(json_object *i) { 115static void pretty_print_input(json_object *i) {
116 json_object *id, *name, *type, *product, *vendor, *kbdlayout; 116 json_object *id, *name, *type, *product, *vendor, *kbdlayout, *events;
117 json_object_object_get_ex(i, "identifier", &id); 117 json_object_object_get_ex(i, "identifier", &id);
118 json_object_object_get_ex(i, "name", &name); 118 json_object_object_get_ex(i, "name", &name);
119 json_object_object_get_ex(i, "type", &type); 119 json_object_object_get_ex(i, "type", &type);
@@ -139,6 +139,10 @@ static void pretty_print_input(json_object *i) {
139 json_object_get_string(kbdlayout)); 139 json_object_get_string(kbdlayout));
140 } 140 }
141 141
142 if (json_object_object_get_ex(i, "libinput_send_events", &events)) {
143 printf(" Libinput Send Events: %s\n", json_object_get_string(events));
144 }
145
142 printf("\n"); 146 printf("\n");
143} 147}
144 148