forked from qt-creator/qt-creator
FakeVim: Allow AltGr as modifier to produce normal key values
Task-number: QTCREATORBUG-24673 Change-Id: I6d1aa5badd3077f0885d5b2470527c006096809d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -929,9 +929,14 @@ static bool isOnlyControlModifier(const Qt::KeyboardModifiers &mods)
|
|||||||
return (mods ^ ControlModifier) == Qt::NoModifier;
|
return (mods ^ ControlModifier) == Qt::NoModifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool hasControlModifier(const Qt::KeyboardModifiers &mods)
|
static bool isAcceptableModifier(const Qt::KeyboardModifiers &mods)
|
||||||
{
|
{
|
||||||
return mods.testFlag(ControlModifier);
|
if (mods & ControlModifier) {
|
||||||
|
// Generally, CTRL is not fine, except in combination with ALT.
|
||||||
|
// See QTCREATORBUG-24673
|
||||||
|
return mods & AltModifier;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1106,7 +1111,7 @@ public:
|
|||||||
|
|
||||||
bool is(int c) const
|
bool is(int c) const
|
||||||
{
|
{
|
||||||
return m_xkey == c && !hasControlModifier(m_modifiers);
|
return m_xkey == c && isAcceptableModifier(m_modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isControl() const
|
bool isControl() const
|
||||||
|
Reference in New Issue
Block a user