From 66b5c5a1437f81e9cea94e1a27e48fbf74d8a56d Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:50:52 +0200 Subject: static and functional dispatchers --- src/managers/KeybindManager.hpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/managers/KeybindManager.hpp') 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 #include "../Compositor.hpp" +#include +#include 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> m_mDispatchers; + private: std::deque 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 g_pKeybindManager; \ No newline at end of file -- cgit v1.2.3