diff options
| author | ArchSav <96357545+ArchSav@users.noreply.github.com> | 2026-03-14 00:48:01 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-13 08:48:01 -0500 |
| commit | 24a95621e5118e39e1a6e05b17ef89f4ec2c8c01 (patch) | |
| tree | a37133cd549fb7107ebbaa5bf60fafd52a5bdd77 /src/managers/KeybindManager.hpp | |
| parent | e8684034525829d58054c32da914d1713398fbb8 (diff) | |
input: add device specific binds (#13073)
Adds support for device-specific binds
Diffstat (limited to 'src/managers/KeybindManager.hpp')
| -rw-r--r-- | src/managers/KeybindManager.hpp | 57 |
1 files changed, 30 insertions, 27 deletions
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 <vector> #include <set> +#include <unordered_set> #include <unordered_map> #include <functional> #include <xkbcommon/xkbcommon.h> @@ -26,30 +27,32 @@ struct SSubmap { }; struct SKeybind { - std::string key = ""; - std::set<xkb_keysym_t> sMkKeys = {}; - uint32_t keycode = 0; - bool catchAll = false; - uint32_t modmask = 0; - std::set<xkb_keysym_t> 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<xkb_keysym_t> sMkKeys = {}; + uint32_t keycode = 0; + bool catchAll = false; + uint32_t modmask = 0; + std::set<xkb_keysym_t> 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<std::string> devices = {}; // DO NOT INITIALIZE bool shadowed = false; @@ -94,8 +97,8 @@ class CKeybindManager { ~CKeybindManager(); bool onKeyEvent(std::any, SP<IKeyboard>); - bool onAxisEvent(const IPointer::SAxisEvent&); - bool onMouseEvent(const IPointer::SButtonEvent&); + bool onAxisEvent(const IPointer::SAxisEvent&, SP<IPointer>); + bool onMouseEvent(const IPointer::SButtonEvent&, SP<IPointer>); 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<IKeyboard>); + SDispatchResult handleKeybinds(const uint32_t, const SPressedKeyWithMods&, bool, SP<IKeyboard>, SP<IHID>); std::set<xkb_keysym_t> m_mkKeys = {}; std::set<xkb_keysym_t> m_mkMods = {}; |
