mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user