From 24a95621e5118e39e1a6e05b17ef89f4ec2c8c01 Mon Sep 17 00:00:00 2001 From: ArchSav <96357545+ArchSav@users.noreply.github.com> Date: Sat, 14 Mar 2026 00:48:01 +1100 Subject: input: add device specific binds (#13073) Adds support for device-specific binds --- src/managers/KeybindManager.hpp | 57 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 deletions(-) (limited to 'src/managers/KeybindManager.hpp') diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index 1f013606..16f0b67d 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -3,6 +3,7 @@ #include "../defines.hpp" #include #include +#include #include #include #include @@ -26,30 +27,32 @@ struct SSubmap { }; struct SKeybind { - std::string key = ""; - std::set sMkKeys = {}; - uint32_t keycode = 0; - bool catchAll = false; - uint32_t modmask = 0; - std::set sMkMods = {}; - std::string handler = ""; - std::string arg = ""; - bool locked = false; - SSubmap submap = {}; - std::string description = ""; - bool release = false; - bool repeat = false; - bool longPress = false; - bool mouse = false; - bool nonConsuming = false; - bool transparent = false; - bool ignoreMods = false; - bool multiKey = false; - bool hasDescription = false; - bool dontInhibit = false; - bool click = false; - bool drag = false; - bool submapUniversal = false; + std::string key = ""; + std::set sMkKeys = {}; + uint32_t keycode = 0; + bool catchAll = false; + uint32_t modmask = 0; + std::set sMkMods = {}; + std::string handler = ""; + std::string arg = ""; + bool locked = false; + SSubmap submap = {}; + std::string description = ""; + bool release = false; + bool repeat = false; + bool longPress = false; + bool mouse = false; + bool nonConsuming = false; + bool transparent = false; + bool ignoreMods = false; + bool multiKey = false; + bool hasDescription = false; + bool dontInhibit = false; + bool click = false; + bool drag = false; + bool submapUniversal = false; + bool deviceInclusive = false; + std::unordered_set devices = {}; // DO NOT INITIALIZE bool shadowed = false; @@ -94,8 +97,8 @@ class CKeybindManager { ~CKeybindManager(); bool onKeyEvent(std::any, SP); - bool onAxisEvent(const IPointer::SAxisEvent&); - bool onMouseEvent(const IPointer::SButtonEvent&); + bool onAxisEvent(const IPointer::SAxisEvent&, SP); + bool onMouseEvent(const IPointer::SButtonEvent&, SP); void resizeWithBorder(const IPointer::SButtonEvent&); void onSwitchEvent(const std::string&); void onSwitchOnEvent(const std::string&); @@ -145,7 +148,7 @@ class CKeybindManager { CTimer m_scrollTimer; - SDispatchResult handleKeybinds(const uint32_t, const SPressedKeyWithMods&, bool, SP); + SDispatchResult handleKeybinds(const uint32_t, const SPressedKeyWithMods&, bool, SP, SP); std::set m_mkKeys = {}; std::set m_mkMods = {}; -- cgit v1.2.3