Commit b8410a4c authored by Victor Yacovlev's avatar Victor Yacovlev

Win32: Fixed non-latin keyboard Esc-sequences

parent a5001d20
......@@ -413,9 +413,9 @@ bool EditorInstance::tryEscKeyAction(const QString &text)
return false; // workarund required only for non-latin keys
}
const QList<Macro> allMacros = systemMacros_ + userMacros_;
const QChar ch = text.at(0);
const QChar ch = text.at(0).toUpper();
foreach (const Macro & m, allMacros) {
bool keyMatch = m.key == ch;
bool keyMatch = m.key.toUpper() == ch;
bool enabled = m.action && m.action->isEnabled();
if (keyMatch && enabled) {
m.action->trigger();
......
......@@ -1227,6 +1227,11 @@ void EditorPlane::keyReleaseEvent(QKeyEvent *e)
escPressFlag_ = true;
}
else {
#ifdef QT_NONLATIN_SHORTCUTS_BUG
if (escPressFlag_ && e->text().length() > 0) {
editor_->tryEscKeyAction(e->text());
}
#endif
escPressFlag_ = false;
}
if (editor_->cursor()->isEnabled()) {
......@@ -1522,17 +1527,13 @@ void EditorPlane::keyPressEvent(QKeyEvent *e)
!e->modifiers().testFlag(Qt::ControlModifier) &&
!ignoreTextEvent
) {
bool escSequence = false;
#ifdef QT_NONLATIN_SHORTCUTS_BUG
escSequence = escPressFlag_ && editor_->tryEscKeyAction(e->text());
#endif
if (!escSequence) {
editor_->cursor()->evaluateCommand(Utils::textByKey(Qt::Key(e->key())
, e->text()
, e->modifiers().testFlag(Qt::ShiftModifier)
, editor_->isTeacherMode() && editor_->analizer()
));
}
editor_->cursor()->evaluateCommand(Utils::textByKey(Qt::Key(e->key())
, e->text()
, e->modifiers().testFlag(Qt::ShiftModifier)
, editor_->isTeacherMode() && editor_->analizer()
));
}
Qt::Key tempSwichLayoutKey = Qt::Key(
......
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