Exemple #1
0
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);
}
Exemple #2
0
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);
}
Exemple #3
0
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);
    }
}
Exemple #4
0
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;
            }
        }
    }
}
Exemple #5
0
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;
            }
        }
    }
}