forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.0'
This commit is contained in:
@@ -784,6 +784,12 @@ static const QMap<QString, int> &vimKeyNames()
|
||||
return k;
|
||||
}
|
||||
|
||||
bool isControlModifier(const Qt::KeyboardModifiers &mods)
|
||||
{
|
||||
static const int ctrl = HostOsInfo::controlModifier();
|
||||
return (mods & ctrl) == ctrl;
|
||||
}
|
||||
|
||||
|
||||
Range::Range()
|
||||
: beginPos(-1), endPos(-1), rangemode(RangeCharMode)
|
||||
@@ -938,12 +944,12 @@ public:
|
||||
|
||||
bool is(int c) const
|
||||
{
|
||||
return m_xkey == c && m_modifiers != HostOsInfo::controlModifier();
|
||||
return m_xkey == c && !isControl();
|
||||
}
|
||||
|
||||
bool isControl() const
|
||||
{
|
||||
return m_modifiers == HostOsInfo::controlModifier();
|
||||
return isControlModifier(m_modifiers);
|
||||
}
|
||||
|
||||
bool isControl(int c) const
|
||||
@@ -2215,7 +2221,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
|
||||
}
|
||||
|
||||
// We are interested in overriding most Ctrl key combinations.
|
||||
if (mods == HostOsInfo::controlModifier()
|
||||
if (isControlModifier(mods)
|
||||
&& !config(ConfigPassControlKey).toBool()
|
||||
&& ((key >= Key_A && key <= Key_Z && key != Key_K)
|
||||
|| key == Key_BracketLeft || key == Key_BracketRight)) {
|
||||
|
||||
Reference in New Issue
Block a user