summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.hpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-21 15:50:52 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-21 15:50:52 +0200
commit66b5c5a1437f81e9cea94e1a27e48fbf74d8a56d (patch)
tree13d377214e2235b25ad6ad8ee973a903b1a94bb3 /src/managers/KeybindManager.hpp
parentab2c65e535bef2acc5c6b0a0c12af1b112652499 (diff)
static and functional dispatchers
Diffstat (limited to 'src/managers/KeybindManager.hpp')
-rw-r--r--src/managers/KeybindManager.hpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp
index 30e03823..e262081e 100644
--- a/src/managers/KeybindManager.hpp
+++ b/src/managers/KeybindManager.hpp
@@ -3,6 +3,8 @@
#include "../defines.hpp"
#include <deque>
#include "../Compositor.hpp"
+#include <unordered_map>
+#include <functional>
struct SKeybind {
std::string key = 0;
@@ -13,29 +15,33 @@ struct SKeybind {
class CKeybindManager {
public:
+ CKeybindManager();
+
bool handleKeybinds(const uint32_t&, const xkb_keysym_t&);
void addKeybind(SKeybind);
uint32_t stringToModMask(std::string);
void clearKeybinds();
+ std::unordered_map<std::string, std::function<void(std::string)>> m_mDispatchers;
+
private:
std::deque<SKeybind> m_dKeybinds;
bool handleInternalKeybinds(xkb_keysym_t);
// -------------- Dispatchers -------------- //
- void killActive(std::string);
- void spawn(std::string);
- void toggleActiveFloating(std::string);
- void toggleActivePseudo(std::string);
- void changeworkspace(std::string);
- void fullscreenActive(std::string);
- void moveActiveToWorkspace(std::string);
- void moveFocusTo(std::string);
- void moveActiveTo(std::string);
- void toggleGroup(std::string);
- void changeGroupActive(std::string);
- void alterSplitRatio(std::string);
+ static void killActive(std::string);
+ static void spawn(std::string);
+ static void toggleActiveFloating(std::string);
+ static void toggleActivePseudo(std::string);
+ static void changeworkspace(std::string);
+ static void fullscreenActive(std::string);
+ static void moveActiveToWorkspace(std::string);
+ static void moveFocusTo(std::string);
+ static void moveActiveTo(std::string);
+ static void toggleGroup(std::string);
+ static void changeGroupActive(std::string);
+ static void alterSplitRatio(std::string);
};
inline std::unique_ptr<CKeybindManager> g_pKeybindManager; \ No newline at end of file