From ce17961aad6f9164e5d026d19efd42b07b123bff Mon Sep 17 00:00:00 2001 From: Can <45462997+yungcxn@users.noreply.github.com> Date: Fri, 24 May 2024 20:58:26 +0200 Subject: keybinds: Added new dispatcher (sendshortcut) (#6174) --- src/managers/KeybindManager.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/managers/KeybindManager.hpp') diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp index a2025bb0..a5499987 100644 --- a/src/managers/KeybindManager.hpp +++ b/src/managers/KeybindManager.hpp @@ -95,6 +95,12 @@ class CKeybindManager { std::list m_lKeybinds; + //since we cant find keycode through keyname in xkb: + //on sendshortcut call, we once search for keyname (e.g. "g") the correct keycode (e.g. 42) + //and cache it in this map to make sendshortcut calls faster + //we also store the keyboard pointer (in the string) to differentiate between different keyboard (layouts) + std::unordered_map m_mKeyToCodeCache; + private: std::deque m_dPressedKeys; @@ -177,6 +183,7 @@ class CKeybindManager { static void focusWindow(std::string); static void setSubmap(std::string); static void pass(std::string); + static void sendshortcut(std::string); static void layoutmsg(std::string); static void toggleOpaque(std::string); static void dpms(std::string); -- cgit v1.2.3