refs #313 Remove any occurence of function or virtual keycode from CKeyboardKey(list)

Justification for native virtual key is, because its not cross platform.
This commit is contained in:
Roland Winklmeier
2014-08-04 20:17:55 +02:00
parent c6540e8521
commit 50b5e80057
7 changed files with 10 additions and 155 deletions

View File

@@ -22,22 +22,6 @@ namespace BlackMisc
CSequence<CKeyboardKey>(baseClass)
{ }
/*
* Contains this hotkey function?
*/
bool CKeyboardKeyList::containsFunction(CKeyboardKey::HotkeyFunction function) const
{
return CSequence::contains(&CKeyboardKey::getFunction, function);
}
/*
* Key for function
*/
CKeyboardKey CKeyboardKeyList::keyForFunction(CKeyboardKey::HotkeyFunction function) const
{
return this->findBy(&CKeyboardKey::getFunction, function).frontOrDefault({ CKeyboardKey::HotkeyNone });
}
/*
* Register metadata
*/
@@ -51,19 +35,5 @@ namespace BlackMisc
qDBusRegisterMetaType<CKeyboardKeyList>();
}
/*
* Hotkey list
*/
void CKeyboardKeyList::initAsHotkeyList(bool reset)
{
if (reset) this->clear();
if (!this->containsFunction(CKeyboardKey::HotkeyPtt)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyPtt));
if (!this->containsFunction(CKeyboardKey::HotkeyOpacity50)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyOpacity50));
if (!this->containsFunction(CKeyboardKey::HotkeyOpacity100)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyOpacity100));
if (!this->containsFunction(CKeyboardKey::HotkeyToggleCom1)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyToggleCom1));
if (!this->containsFunction(CKeyboardKey::HotkeyToggleCom2)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyToggleCom2));
if (!this->containsFunction(CKeyboardKey::HotkeyToogleWindowsStayOnTop)) this->push_back(CKeyboardKey(CKeyboardKey::HotkeyToogleWindowsStayOnTop));
}
} // namespace
} // namespace