void KwmAddHotkey(std::string KeySym, std::string Command, bool Passthrough, bool KeycodeInHex) { hotkey Hotkey = {}; if(KwmParseHotkey(KeySym, Command, &Hotkey, Passthrough, KeycodeInHex) && !HotkeyExists(Hotkey.Mod, Hotkey.Key, NULL, Hotkey.Mode)) KWMHotkeys.Modes[Hotkey.Mode].Hotkeys.push_back(Hotkey); }
void KwmAddHotkey(std::string KeySym, std::string Command) { hotkey Hotkey = {}; if(KwmParseHotkey(KeySym, Command, &Hotkey) && !HotkeyExists(Hotkey.Mod, Hotkey.Key, NULL)) KWMHotkeys.List.push_back(Hotkey); }
void KwmSetPrefix(std::string KeySym) { hotkey Hotkey = {}; if(KwmParseHotkey(KeySym, "", &Hotkey)) { KWMHotkeys.Prefix.Key = Hotkey; KWMHotkeys.Prefix.Active = false; KWMHotkeys.Prefix.Enabled = true; ClearBorder(&PrefixBorder); } }
void KwmRemoveHotkey(std::string KeySym) { hotkey NewHotkey = {}; if(KwmParseHotkey(KeySym, "", &NewHotkey)) { for(std::size_t HotkeyIndex = 0; HotkeyIndex < KWMHotkeys.List.size(); ++HotkeyIndex) { if(HotkeysAreEqual(&KWMHotkeys.List[HotkeyIndex], &NewHotkey)) { KWMHotkeys.List.erase(KWMHotkeys.List.begin() + HotkeyIndex); break; } } } }
void KwmRemoveHotkey(std::string KeySym, bool KeycodeInHex) { hotkey NewHotkey = {}; if(KwmParseHotkey(KeySym, "", &NewHotkey, false, KeycodeInHex)) { mode *BindingMode = GetBindingMode(NewHotkey.Mode); for(std::size_t HotkeyIndex = 0; HotkeyIndex < BindingMode->Hotkeys.size(); ++HotkeyIndex) { hotkey *CurrentHotkey = &BindingMode->Hotkeys[HotkeyIndex]; if(HotkeysAreEqual(CurrentHotkey, &NewHotkey)) { BindingMode->Hotkeys.erase(BindingMode->Hotkeys.begin() + HotkeyIndex); break; } } } }