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:
hjk
2020-10-08 05:43:39 +02:00
parent 92cce87433
commit 35932385bc

View File

@@ -929,9 +929,14 @@ static bool isOnlyControlModifier(const Qt::KeyboardModifiers &mods)
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
{
return m_xkey == c && !hasControlModifier(m_modifiers);
return m_xkey == c && isAcceptableModifier(m_modifiers);
}
bool isControl() const