bool CKeyBindings::AddKeySymbol(const string& keysym, const string& code) { CKeySet ks; if (!ks.Parse(code)) { LOG_L(L_WARNING, "AddKeySymbol: could not parse key: %s", code.c_str()); return false; } if (!keyCodes->AddKeySymbol(keysym, ks.Key())) { LOG_L(L_WARNING, "AddKeySymbol: could not add: %s", keysym.c_str()); return false; } return true; }
bool CKeyBindings::AddKeySymbol(const string& keysym, const string& code) { CKeySet ks; if (!ks.Parse(code)) { logOutput.Print("AddKeySymbol: could not parse key: %s\n", code.c_str()); return false; } if (!keyCodes->AddKeySymbol(keysym, ks.Key())) { logOutput.Print("AddKeySymbol: could not add: %s\n", keysym.c_str()); return false; } return true; }
bool CKeyBindings::AddNamedKeySet(const string& name, const string& keystr) { CKeySet ks; if (!ks.Parse(keystr)) { printf("AddNamedKeySet: could not parse keyset: %s\n", keystr.c_str()); return false; } if ((ks.Key() < 0) || !CKeyCodes::IsValidLabel(name)) { printf("AddNamedKeySet: bad custom keyset name: %s\n", name.c_str()); return false; } namedKeySets[name] = ks; }
bool CKeyBindings::SetFakeMetaKey(const string& keystr) { CKeySet ks; if (StringToLower(keystr) == "none") { fakeMetaKey = -1; return true; } if (!ks.Parse(keystr)) { LOG_L(L_WARNING, "SetFakeMetaKey: could not parse key: %s", keystr.c_str()); return false; } fakeMetaKey = ks.Key(); return true; }
bool CKeyBindings::SetFakeMetaKey(const string& keystr) { CKeySet ks; if (StringToLower(keystr) == "none") { fakeMetaKey = -1; return true; } if (!ks.Parse(keystr)) { logOutput.Print("SetFakeMetaKey: could not parse key: %s\n", keystr.c_str()); return false; } fakeMetaKey = ks.Key(); return true; }