summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp')
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index b21d5d9ef5..ad134a825f 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -76,7 +76,7 @@ void QFdContainer::reset() Q_DECL_NOTHROW
QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, QFdContainer &fd, bool disableZap, bool enableCompose, const QString &keymapFile)
: m_device(device), m_fd(fd.release()), m_notify(nullptr),
m_modifiers(0), m_composing(0), m_dead_unicode(0xffff),
- m_no_zap(disableZap), m_do_compose(enableCompose),
+ m_langLock(0), m_no_zap(disableZap), m_do_compose(enableCompose),
m_keymap(0), m_keymap_size(0), m_keycompose(0), m_keycompose_size(0)
{
qCDebug(qLcEvdevKey) << "Create keyboard handler with for device" << device;
@@ -253,6 +253,8 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
quint8 testmods = m_modifiers;
if (m_locks[0] /*CapsLock*/ && (m->flags & QEvdevKeyboardMap::IsLetter))
testmods ^= QEvdevKeyboardMap::ModShift;
+ if (m_langLock)
+ testmods ^= QEvdevKeyboardMap::ModAltGr;
if (m->modifiers == testmods)
map_withmod = m;
}
@@ -509,6 +511,8 @@ void QEvdevKeyboardHandler::unloadKeymap()
m_locks[2] = 1;
qCDebug(qLcEvdevKey, "numlock=%d , capslock=%d, scrolllock=%d", m_locks[1], m_locks[0], m_locks[2]);
}
+
+ m_langLock = 0;
}
bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
@@ -570,4 +574,9 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
return true;
}
+void QEvdevKeyboardHandler::switchLang()
+{
+ m_langLock ^= 1;
+}
+
QT_END_NAMESPACE