summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorElena Zaretskaya <sweetiebrier@yandex.ru>2019-01-11 10:11:03 -0500
committerElena Zaretskaya <sweetiebrier@yandex.ru>2019-01-25 15:00:07 +0000
commitc9b9a0ea2f274688da26af20102d349336fdb2a0 (patch)
tree53168ab420947b6ac5388e87c0e601b8f590f5e5 /src/plugins/platforms/eglfs
parentc4e7f3ab6555c87fb41c5f341524445283720e6a (diff)
Ability to switch language under platform eglfs/linuxfb
I need to change keymap under platforms eglfs and linuxfb (without wayland). I use the function QEglFSFunctions::loadKeymap(const QString&), but there's no way to switch between english and another language than to press AltGr as a modifier. I added the function that allows to change the language. And also added the ability to switch the keymap and language for the platform linuxfb and also added the ability to switch the keymap and language for the platform linuxfb Task-number: QTBUG-72452 Change-Id: I37432cf60d375555bea2bf668ec1387322b4964f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp13
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration_p.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 72420199e3..8ccb0ef2cd 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -429,6 +429,8 @@ QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function)
#if QT_CONFIG(evdev)
if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
return QFunctionPointer(loadKeymapStatic);
+ else if (function == QEglFSFunctions::switchLangTypeIdentifier())
+ return QFunctionPointer(switchLangStatic);
#endif
return qt_egl_device_integration()->platformFunction(function);
@@ -447,6 +449,17 @@ void QEglFSIntegration::loadKeymapStatic(const QString &filename)
#endif
}
+void QEglFSIntegration::switchLangStatic()
+{
+#if QT_CONFIG(evdev)
+ QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ if (self->m_kbdMgr)
+ self->m_kbdMgr->switchLang();
+ else
+ qWarning("QEglFSIntegration: Cannot switch language, no keyboard handler found");
+#endif
+}
+
void QEglFSIntegration::createInputHandlers()
{
#if QT_CONFIG(libinput)
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
index c288876678..4b4585d33c 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
@@ -110,6 +110,7 @@ private:
EGLNativeDisplayType nativeDisplay() const;
void createInputHandlers();
static void loadKeymapStatic(const QString &filename);
+ static void switchLangStatic();
EGLDisplay m_display;
QPlatformInputContext *m_inputContext;