refactor: Remove undocumented hold modifiers to switch code
This commit is contained in:
parent
55b6789728
commit
a45e81fb15
4 changed files with 1 additions and 31 deletions
|
|
@ -628,12 +628,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
|||
} catch (SocketAddressException &e) {
|
||||
throw ServerConfigReadException(s, std::string("invalid address argument ") + e.what());
|
||||
}
|
||||
} else if (name == "switchNeedsShift") {
|
||||
addOption("", kOptionScreenSwitchNeedsShift, s.parseBoolean(value));
|
||||
} else if (name == "switchNeedsControl") {
|
||||
addOption("", kOptionScreenSwitchNeedsControl, s.parseBoolean(value));
|
||||
} else if (name == "switchNeedsAlt") {
|
||||
addOption("", kOptionScreenSwitchNeedsAlt, s.parseBoolean(value));
|
||||
} else {
|
||||
handled = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ private:
|
|||
QStringLiteral("clipboardSharingSize"),
|
||||
QStringLiteral("switchCornerSize"),
|
||||
QStringLiteral("switchCorners"),
|
||||
QStringLiteral("switchNeeds"),
|
||||
QStringLiteral("protocol"),
|
||||
QStringLiteral("heartbeat"),
|
||||
QStringLiteral("switchDelay"),
|
||||
|
|
|
|||
|
|
@ -841,16 +841,6 @@ bool Server::isSwitchOkay(
|
|||
stopSwitch();
|
||||
}
|
||||
|
||||
// check for optional needed modifiers
|
||||
if (KeyModifierMask mods = this->m_primaryClient->getToggleMask();
|
||||
!preventSwitch && ((this->m_switchNeedsShift && ((mods & KeyModifierShift) != KeyModifierShift)) ||
|
||||
(this->m_switchNeedsControl && ((mods & KeyModifierControl) != KeyModifierControl)) ||
|
||||
(this->m_switchNeedsAlt && ((mods & KeyModifierAlt) != KeyModifierAlt)))) {
|
||||
LOG_VERBOSE("need modifiers to switch");
|
||||
preventSwitch = true;
|
||||
stopSwitch();
|
||||
}
|
||||
|
||||
return !preventSwitch;
|
||||
}
|
||||
|
||||
|
|
@ -1076,10 +1066,6 @@ void Server::processOptions()
|
|||
return;
|
||||
}
|
||||
|
||||
m_switchNeedsShift = false; // it seems if i don't add these
|
||||
m_switchNeedsControl = false; // lines, the 'reload config' option
|
||||
m_switchNeedsAlt = false; // doesnt' work correct.
|
||||
|
||||
bool newRelativeMoves = m_relativeMoves;
|
||||
for (auto [optionId, optionValue] : *options) {
|
||||
const OptionID id = optionId;
|
||||
|
|
@ -1096,12 +1082,6 @@ void Server::processOptions()
|
|||
m_switchTwoTapDelay = 0.0;
|
||||
}
|
||||
stopSwitchTwoTap();
|
||||
} else if (id == kOptionScreenSwitchNeedsControl) {
|
||||
m_switchNeedsControl = (value != 0);
|
||||
} else if (id == kOptionScreenSwitchNeedsShift) {
|
||||
m_switchNeedsShift = (value != 0);
|
||||
} else if (id == kOptionScreenSwitchNeedsAlt) {
|
||||
m_switchNeedsAlt = (value != 0);
|
||||
} else if (id == kOptionRelativeMouseMoves) {
|
||||
newRelativeMoves = (value != 0);
|
||||
} else if (id == kOptionDefaultLockToScreenState) {
|
||||
|
|
|
|||
|
|
@ -454,11 +454,6 @@ private:
|
|||
bool m_switchTwoTapEngaged = false;
|
||||
bool m_switchTwoTapArmed = false;
|
||||
|
||||
// modifiers needed before switching
|
||||
bool m_switchNeedsShift = false;
|
||||
bool m_switchNeedsControl = false;
|
||||
bool m_switchNeedsAlt = false;
|
||||
|
||||
// relative mouse move option
|
||||
bool m_relativeMoves = false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue