keybinds: Added new dispatcher (sendshortcut) (#6174)

This commit is contained in:
Can
2024-05-24 20:58:26 +02:00
committed by GitHub
parent 6d67b84469
commit ce17961aad
7 changed files with 174 additions and 9 deletions

View File

@@ -95,6 +95,12 @@ class CKeybindManager {
std::list<SKeybind> 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<std::string, xkb_keycode_t> m_mKeyToCodeCache;
private:
std::deque<SPressedKeyWithMods> 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);