From 47404534d0cf94b969daee5e0e4dc20c65c35fb2 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 9 Jun 2022 12:46:55 +0200 Subject: added tablet v2 support (alpha alpha) --- src/events/Devices.cpp | 14 ++++++++++---- src/events/Layers.cpp | 2 +- src/events/Misc.cpp | 2 +- src/events/Monitors.cpp | 2 +- src/events/Popups.cpp | 2 +- src/events/Windows.cpp | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/events') diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp index 89443af2..7a47df77 100644 --- a/src/events/Devices.cpp +++ b/src/events/Devices.cpp @@ -2,7 +2,7 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" // ---------------------------------------------------- // @@ -78,14 +78,20 @@ void Events::listener_newInput(wl_listener* listener, void* data) { Debug::log(WARN, "!!!! Hyprland does not directly support touchscreens, bugs may occur !!!!"); wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, DEVICE); break; + case WLR_INPUT_DEVICE_TABLET_TOOL: + Debug::log(LOG, "Attached a tablet tool with name %s", DEVICE->name); + g_pInputManager->newTabletTool(DEVICE); + break; + case WLR_INPUT_DEVICE_TABLET_PAD: + Debug::log(LOG, "Attached a tablet pad with name %s", DEVICE->name); + g_pInputManager->newTabletPad(DEVICE); + break; default: Debug::log(WARN, "Unrecognized input device plugged in: %s", DEVICE->name); break; } - uint32_t capabilities = WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD; - - wlr_seat_set_capabilities(g_pCompositor->m_sSeat.seat, capabilities); + g_pInputManager->updateCapabilities(DEVICE); } void Events::listener_newConstraint(wl_listener* listener, void* data) { diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 1503f8cb..a1aa7764 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -1,6 +1,6 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" #include "Events.hpp" diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp index eec42f6d..c25b1c6a 100644 --- a/src/events/Misc.cpp +++ b/src/events/Misc.cpp @@ -2,7 +2,7 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" // ------------------------------ // diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 7756bfa2..accdd3d7 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -1,6 +1,6 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" #include "Events.hpp" #include "../debug/HyprCtl.hpp" diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp index 457a95fe..0b075295 100644 --- a/src/events/Popups.cpp +++ b/src/events/Popups.cpp @@ -2,7 +2,7 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" // --------------------------------------------- // diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index ffe2ac96..b84b9d2d 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -2,7 +2,7 @@ #include "../Compositor.hpp" #include "../helpers/WLClasses.hpp" -#include "../managers/InputManager.hpp" +#include "../managers/input/InputManager.hpp" #include "../render/Renderer.hpp" // ------------------------------------------------------------ // -- cgit v1.2.3