diff --git a/plugins/ipc-rules/ipc-input-methods.hpp b/plugins/ipc-rules/ipc-input-methods.hpp index ecd4c281b..1b7a6777c 100644 --- a/plugins/ipc-rules/ipc-input-methods.hpp +++ b/plugins/ipc-rules/ipc-input-methods.hpp @@ -55,9 +55,20 @@ class ipc_rules_input_methods_t for (auto& device : wf::get_core().get_input_devices()) { nlohmann::json d; - d["id"] = (intptr_t)device->get_wlr_handle(); - d["name"] = nonull(device->get_wlr_handle()->name); - d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type); + d["id"] = (intptr_t)device->get_wlr_handle(); + d["name"] = nonull(device->get_wlr_handle()->name); + d["vendor"] = "unknown"; + d["product"] = "unknown"; + if (wlr_input_device_is_libinput(device->get_wlr_handle())) + { + if (auto libinput_handle = wlr_libinput_get_device_handle(device->get_wlr_handle())) + { + d["vendor"] = libinput_device_get_id_vendor(libinput_handle); + d["product"] = libinput_device_get_id_product(libinput_handle); + } + } + + d["type"] = wlr_input_device_type_to_string(device->get_wlr_handle()->type); d["enabled"] = device->is_enabled(); response.push_back(d); }