summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.hpp
diff options
context:
space:
mode:
authorGabriel Ford <gabe@fordltc.net>2024-05-16 10:48:30 +0000
committerGitHub <noreply@github.com>2024-05-16 11:48:30 +0100
commitd693c448366131de9e5729690a6d894fd1adff5e (patch)
treeaf0dd6ec05e04f4b66323063e353c95f62886991 /src/managers/KeybindManager.hpp
parentca0833c9ed6d6034b360d0ea83f3ac942ffb45b5 (diff)
keybinds: add keybind combos and add Left and Right mod distinction. (#5966)
Diffstat (limited to 'src/managers/KeybindManager.hpp')
-rw-r--r--src/managers/KeybindManager.hpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp
index da98a749..a2025bb0 100644
--- a/src/managers/KeybindManager.hpp
+++ b/src/managers/KeybindManager.hpp
@@ -2,6 +2,7 @@
#include "../defines.hpp"
#include <deque>
+#include <set>
#include "../Compositor.hpp"
#include <unordered_map>
#include <functional>
@@ -13,20 +14,23 @@ class CPluginSystem;
class IKeyboard;
struct SKeybind {
- std::string key = "";
- uint32_t keycode = 0;
- bool catchAll = false;
- uint32_t modmask = 0;
- std::string handler = "";
- std::string arg = "";
- bool locked = false;
- std::string submap = "";
- bool release = false;
- bool repeat = false;
- bool mouse = false;
- bool nonConsuming = false;
- bool transparent = false;
- bool ignoreMods = 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;
+ std::string submap = "";
+ bool release = false;
+ bool repeat = false;
+ bool mouse = false;
+ bool nonConsuming = false;
+ bool transparent = false;
+ bool ignoreMods = false;
+ bool multiKey = false;
// DO NOT INITIALIZE
bool shadowed = false;
@@ -57,6 +61,12 @@ struct SParsedKey {
bool catchAll = false;
};
+enum eMultiKeyCase {
+ MK_NO_MATCH = 0,
+ MK_PARTIAL_MATCH,
+ MK_FULL_MATCH
+};
+
class CKeybindManager {
public:
CKeybindManager();
@@ -105,6 +115,11 @@ class CKeybindManager {
bool handleKeybinds(const uint32_t, const SPressedKeyWithMods&, bool);
+ std::set<xkb_keysym_t> m_sMkKeys = {};
+ std::set<xkb_keysym_t> m_sMkMods = {};
+ eMultiKeyCase mkBindMatches(const SKeybind);
+ eMultiKeyCase mkKeysymSetMatches(const std::set<xkb_keysym_t>, const std::set<xkb_keysym_t>);
+
bool handleInternalKeybinds(xkb_keysym_t);
bool handleVT(xkb_keysym_t);