Commit 5a268789 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

FakeVim: Fix control modifier test

* Fix logic
* Rename the function

Change-Id: Ifa0bb77693e17ee75f30646ea3bbbf858e6e391c
Reviewed-by: default avatarLukas Holecek <hluk@email.cz>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 03042a29
......@@ -784,10 +784,9 @@ static const QMap<QString, int> &vimKeyNames()
return k;
}
bool isControlModifier(const Qt::KeyboardModifiers &mods)
static bool isOnlyControlModifier(const Qt::KeyboardModifiers &mods)
{
static const int ctrl = HostOsInfo::controlModifier();
return (mods & ctrl) == ctrl;
return (mods ^ HostOsInfo::controlModifier()) == Qt::NoModifier;
}
......@@ -949,7 +948,7 @@ public:
bool isControl() const
{
return isControlModifier(m_modifiers);
return isOnlyControlModifier(m_modifiers);
}
bool isControl(int c) const
......@@ -2221,7 +2220,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
}
// We are interested in overriding most Ctrl key combinations.
if (isControlModifier(mods)
if (isOnlyControlModifier(mods)
&& !config(ConfigPassControlKey).toBool()
&& ((key >= Key_A && key <= Key_Z && key != Key_K)
|| key == Key_BracketLeft || key == Key_BracketRight)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment