summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łoś <[email protected]>2024-10-03 10:40:28 +0200
committerMichał Łoś <[email protected]>2024-10-30 22:22:59 +0200
commit35f0560a2d4524e9a8d24f0a52e978f510f2125d (patch)
tree35c13bb85da5a919a251d8f60083db9c0b9e7628
parent9ef87298e58396e493558d307ef318098068ec67 (diff)
Introduce VxKeyboard input plugin
Introduce VxKeyboard plugin which is responsible for handling keyboard on VxWorks OS. Due to the fact that VxWorks is using its own, not fully compatible with Unix/Linux implementation of libevdev, it requires it's own plugin. This way, changes in evdev plugins will not be blocked/complicated by VxWorks stalled implementation. Implement VxKeyboard plugin and its backend, adding support for it in eglfs. This is a preparatory change, as there is no keyboard detection for VxWorks yet. Task-number: QTBUG-115777 Change-Id: I4ca5729c6f210fb7477bc31371a137071e12fdad Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/gui/kernel/qkeymapper.cpp4
-rw-r--r--src/gui/kernel/qkeymapper_p.h9
-rw-r--r--src/gui/platform/unix/qunixnativeinterface.cpp15
-rw-r--r--src/platformsupport/input/CMakeLists.txt5
-rw-r--r--src/platformsupport/input/vxkeyboard/qvxkeyboard_defaultmap_p.h763
-rw-r--r--src/platformsupport/input/vxkeyboard/qvxkeyboardhandler.cpp492
-rw-r--r--src/platformsupport/input/vxkeyboard/qvxkeyboardhandler_p.h167
-rw-r--r--src/platformsupport/input/vxkeyboard/qvxkeyboardmanager.cpp114
-rw-r--r--src/platformsupport/input/vxkeyboard/qvxkeyboardmanager_p.h51
-rw-r--r--src/plugins/generic/CMakeLists.txt1
-rw-r--r--src/plugins/generic/vxkeyboard/CMakeLists.txt20
-rw-r--r--src/plugins/generic/vxkeyboard/main.cpp36
-rw-r--r--src/plugins/generic/vxkeyboard/vxkeyboard.json3
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp11
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration_p.h14
15 files changed, 1697 insertions, 8 deletions
diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp
index 4ceb508465e..386614ef97b 100644
--- a/src/gui/kernel/qkeymapper.cpp
+++ b/src/gui/kernel/qkeymapper.cpp
@@ -84,6 +84,10 @@ void *QKeyMapper::resolveInterface(const char *name, int revision) const
QT_NATIVE_INTERFACE_RETURN_IF(QEvdevKeyMapper, QGuiApplicationPrivate::platformIntegration());
#endif
+#if QT_CONFIG(vxworksevdev)
+ QT_NATIVE_INTERFACE_RETURN_IF(QVxKeyMapper, QGuiApplicationPrivate::platformIntegration());
+#endif
+
return nullptr;
}
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index 1a6a9a608f4..77eaadd8cdd 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -54,6 +54,15 @@ struct Q_GUI_EXPORT QEvdevKeyMapper
};
#endif
+#if QT_CONFIG(vxworksevdev) || defined(Q_QDOC)
+struct Q_GUI_EXPORT QVxKeyMapper
+{
+ QT_DECLARE_NATIVE_INTERFACE(QVxKeyMapper, 1, QKeyMapper)
+ virtual void loadKeymap(const QString &filename) = 0;
+ virtual void switchLang() = 0;
+};
+#endif
+
} // QNativeInterface::Private
diff --git a/src/gui/platform/unix/qunixnativeinterface.cpp b/src/gui/platform/unix/qunixnativeinterface.cpp
index 09561d9adaf..2291467740d 100644
--- a/src/gui/platform/unix/qunixnativeinterface.cpp
+++ b/src/gui/platform/unix/qunixnativeinterface.cpp
@@ -231,6 +231,21 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QEvdevKeyMapper);
#endif // QT_CONFIG(evdev)
+#if QT_CONFIG(vxworksevdev)
+
+/*!
+ \class QNativeInterface::Private::QVxKeyMapper
+ \since 6.8
+ \internal
+ \brief Native interface to QKeyMapper.
+ \inmodule QtGui
+ \ingroup native-interfaces
+*/
+
+QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QVxKeyMapper);
+
+#endif // QT_CONFIG(vxworksevdev)
+
#if QT_CONFIG(wayland)
/*!
diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt
index 8e13b8317f1..33b043628df 100644
--- a/src/platformsupport/input/CMakeLists.txt
+++ b/src/platformsupport/input/CMakeLists.txt
@@ -65,8 +65,13 @@ qt_internal_extend_target(InputSupportPrivate CONDITION QT_FEATURE_evdev AND QT_
qt_internal_extend_target(InputSupportPrivate CONDITION QT_FEATURE_vxworksevdev
SOURCES
+ vxkeyboard/qvxkeyboard_defaultmap_p.h
+ vxkeyboard/qvxkeyboardhandler.cpp vxkeyboard/qvxkeyboardhandler_p.h
+ vxkeyboard/qvxkeyboardmanager.cpp vxkeyboard/qvxkeyboardmanager_p.h
vxmouse/qvxmousehandler.cpp vxmouse/qvxmousehandler_p.h
vxmouse/qvxmousemanager.cpp vxmouse/qvxmousemanager_p.h
+ INCLUDE_DIRECTORIES
+ shared
)
qt_internal_extend_target(InputSupportPrivate CONDITION QT_FEATURE_tslib
diff --git a/src/platformsupport/input/vxkeyboard/qvxkeyboard_defaultmap_p.h b/src/platformsupport/input/vxkeyboard/qvxkeyboard_defaultmap_p.h
new file mode 100644
index 00000000000..75a0afcdb0b
--- /dev/null
+++ b/src/platformsupport/input/vxkeyboard/qvxkeyboard_defaultmap_p.h
@@ -0,0 +1,763 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QVXKEYBOARDHANDLER_DEFAULTMAP_P_H
+#define QVXKEYBOARDHANDLER_DEFAULTMAP_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qnamespace.h"
+#include <QtInputSupport/private/qkeyboardmap_p.h>
+#include "private/qglobal_p.h"
+
+// no QT_BEGIN_NAMESPACE, since we include it internally...
+
+const QKeyboardMap::Mapping QVxKeyboardHandler::s_keymap_default[] = {
+ { 1, 0xffff, 0x01000000, 0x00, 0x00, 0x0000 },
+ { 2, 0x0031, 0x00000031, 0x00, 0x00, 0x0000 },
+ { 2, 0x0021, 0x00000021, 0x01, 0x00, 0x0000 },
+ { 3, 0x0032, 0x00000032, 0x00, 0x00, 0x0000 },
+ { 3, 0x0040, 0x00000040, 0x01, 0x00, 0x0000 },
+ { 3, 0x0040, 0x00000040, 0x02, 0x00, 0x0000 },
+ { 4, 0x0033, 0x00000033, 0x00, 0x00, 0x0000 },
+ { 4, 0x0023, 0x00000023, 0x01, 0x00, 0x0000 },
+ { 4, 0xffff, 0x01000000, 0x04, 0x00, 0x0000 },
+ { 5, 0x0034, 0x00000034, 0x00, 0x00, 0x0000 },
+ { 5, 0x0024, 0x00000024, 0x01, 0x00, 0x0000 },
+ { 5, 0x0024, 0x00000024, 0x02, 0x00, 0x0000 },
+ { 5, 0x005c, 0x0400005c, 0x04, 0x00, 0x0000 },
+ { 6, 0x0035, 0x00000035, 0x00, 0x00, 0x0000 },
+ { 6, 0x0025, 0x00000025, 0x01, 0x00, 0x0000 },
+ { 6, 0x005d, 0x0400005d, 0x04, 0x00, 0x0000 },
+ { 7, 0x0036, 0x00000036, 0x00, 0x00, 0x0000 },
+ { 7, 0x005e, 0x0000005e, 0x01, 0x00, 0x0000 },
+ { 7, 0x005e, 0x01001252, 0x02, 0x01, 0x0000 },
+ { 7, 0x005e, 0x0400005e, 0x04, 0x00, 0x0000 },
+ { 8, 0x0037, 0x00000037, 0x00, 0x00, 0x0000 },
+ { 8, 0x0026, 0x00000026, 0x01, 0x00, 0x0000 },
+ { 8, 0x007b, 0x0000007b, 0x02, 0x00, 0x0000 },
+ { 8, 0x005f, 0x0400005f, 0x04, 0x00, 0x0000 },
+ { 9, 0x0038, 0x00000038, 0x00, 0x00, 0x0000 },
+ { 9, 0x002a, 0x0000002a, 0x01, 0x00, 0x0000 },
+ { 9, 0x005b, 0x0000005b, 0x02, 0x00, 0x0000 },
+ { 9, 0xffff, 0x01000003, 0x04, 0x00, 0x0000 },
+ { 10, 0x0039, 0x00000039, 0x00, 0x00, 0x0000 },
+ { 10, 0x0028, 0x00000028, 0x01, 0x00, 0x0000 },
+ { 10, 0x005d, 0x0000005d, 0x02, 0x00, 0x0000 },
+ { 11, 0x0030, 0x00000030, 0x00, 0x00, 0x0000 },
+ { 11, 0x0029, 0x00000029, 0x01, 0x00, 0x0000 },
+ { 11, 0x007d, 0x0000007d, 0x02, 0x00, 0x0000 },
+ { 12, 0x002d, 0x0000002d, 0x00, 0x00, 0x0000 },
+ { 12, 0x005f, 0x0000005f, 0x01, 0x00, 0x0000 },
+ { 12, 0x005c, 0x0000005c, 0x02, 0x00, 0x0000 },
+ { 12, 0x005f, 0x0400005f, 0x04, 0x00, 0x0000 },
+ { 12, 0x005f, 0x0400005f, 0x05, 0x00, 0x0000 },
+ { 13, 0x003d, 0x0000003d, 0x00, 0x00, 0x0000 },
+ { 13, 0x002b, 0x0000002b, 0x01, 0x00, 0x0000 },
+ { 14, 0xffff, 0x01000003, 0x00, 0x00, 0x0000 },
+ { 14, 0xffff, 0x01000000, 0x0c, 0x08, 0x0300 },
+ { 15, 0xffff, 0x01000001, 0x00, 0x00, 0x0000 },
+ { 16, 0x0071, 0x00000051, 0x00, 0x02, 0x0000 },
+ { 16, 0x0051, 0x00000051, 0x01, 0x02, 0x0000 },
+ { 16, 0x0071, 0x00000051, 0x02, 0x02, 0x0000 },
+ { 16, 0x0051, 0x00000051, 0x03, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x04, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x05, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x06, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x07, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x08, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x09, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x0a, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x0b, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0c, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0d, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0e, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0f, 0x02, 0x0000 },
+ { 17, 0x0077, 0x00000057, 0x00, 0x02, 0x0000 },
+ { 17, 0x0057, 0x00000057, 0x01, 0x02, 0x0000 },
+ { 17, 0x0077, 0x00000057, 0x02, 0x02, 0x0000 },
+ { 17, 0x0057, 0x00000057, 0x03, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x04, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x05, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x06, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x07, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x08, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x09, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x0a, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x0b, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0c, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0d, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0e, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0f, 0x02, 0x0000 },
+ { 18, 0x0065, 0x00000045, 0x00, 0x02, 0x0000 },
+ { 18, 0x0045, 0x00000045, 0x01, 0x02, 0x0000 },
+ { 18, 0x0065, 0x00000045, 0x02, 0x02, 0x0000 },
+ { 18, 0x0045, 0x00000045, 0x03, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x04, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x05, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x06, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x07, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x08, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x09, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x0a, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x0b, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0c, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0d, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0e, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0f, 0x02, 0x0000 },
+ { 19, 0x0072, 0x00000052, 0x00, 0x02, 0x0000 },
+ { 19, 0x0052, 0x00000052, 0x01, 0x02, 0x0000 },
+ { 19, 0x0072, 0x00000052, 0x02, 0x02, 0x0000 },
+ { 19, 0x0052, 0x00000052, 0x03, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x04, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x05, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x06, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x07, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x08, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x09, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x0a, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x0b, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0c, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0d, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0e, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0f, 0x02, 0x0000 },
+ { 20, 0x0074, 0x00000054, 0x00, 0x02, 0x0000 },
+ { 20, 0x0054, 0x00000054, 0x01, 0x02, 0x0000 },
+ { 20, 0x0074, 0x00000054, 0x02, 0x02, 0x0000 },
+ { 20, 0x0054, 0x00000054, 0x03, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x04, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x05, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x06, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x07, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x08, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x09, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x0a, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x0b, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0c, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0d, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0e, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0f, 0x02, 0x0000 },
+ { 21, 0x0079, 0x00000059, 0x00, 0x02, 0x0000 },
+ { 21, 0x0059, 0x00000059, 0x01, 0x02, 0x0000 },
+ { 21, 0x0079, 0x00000059, 0x02, 0x02, 0x0000 },
+ { 21, 0x0059, 0x00000059, 0x03, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x04, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x05, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x06, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x07, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x08, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x09, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x0a, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x0b, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0c, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0d, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0e, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0f, 0x02, 0x0000 },
+ { 22, 0x0075, 0x00000055, 0x00, 0x02, 0x0000 },
+ { 22, 0x0055, 0x00000055, 0x01, 0x02, 0x0000 },
+ { 22, 0x0075, 0x00000055, 0x02, 0x02, 0x0000 },
+ { 22, 0x0055, 0x00000055, 0x03, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x04, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x05, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x06, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x07, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x08, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x09, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x0a, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x0b, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0c, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0d, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0e, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0f, 0x02, 0x0000 },
+ { 23, 0x0069, 0x00000049, 0x00, 0x02, 0x0000 },
+ { 23, 0x0049, 0x00000049, 0x01, 0x02, 0x0000 },
+ { 23, 0x0069, 0x00000049, 0x02, 0x02, 0x0000 },
+ { 23, 0x0049, 0x00000049, 0x03, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x04, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x05, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x06, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x07, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x08, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x09, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x0a, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x0b, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0c, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0d, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0e, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0f, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0000004f, 0x00, 0x02, 0x0000 },
+ { 24, 0x004f, 0x0000004f, 0x01, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0000004f, 0x02, 0x02, 0x0000 },
+ { 24, 0x004f, 0x0000004f, 0x03, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x04, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x05, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x06, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x07, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x08, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x09, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x0a, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x0b, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0c, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0d, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0e, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0f, 0x02, 0x0000 },
+ { 25, 0x0070, 0x00000050, 0x00, 0x02, 0x0000 },
+ { 25, 0x0050, 0x00000050, 0x01, 0x02, 0x0000 },
+ { 25, 0x0070, 0x00000050, 0x02, 0x02, 0x0000 },
+ { 25, 0x0050, 0x00000050, 0x03, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x04, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x05, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x06, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x07, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x08, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x09, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x0a, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x0b, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0c, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0d, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0e, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0f, 0x02, 0x0000 },
+ { 26, 0x005b, 0x0000005b, 0x00, 0x00, 0x0000 },
+ { 26, 0x007b, 0x0000007b, 0x01, 0x00, 0x0000 },
+ { 26, 0xffff, 0x01000000, 0x04, 0x00, 0x0000 },
+ { 27, 0x005d, 0x0000005d, 0x00, 0x00, 0x0000 },
+ { 27, 0x007d, 0x0000007d, 0x01, 0x00, 0x0000 },
+ { 27, 0x007e, 0x0000007e, 0x02, 0x00, 0x0000 },
+ { 27, 0x005d, 0x0400005d, 0x04, 0x00, 0x0000 },
+ { 28, 0xffff, 0x01000004, 0x00, 0x00, 0x0000 },
+ { 28, 0x006d, 0x0c00004d, 0x08, 0x00, 0x0000 },
+ { 29, 0xffff, 0x01000021, 0x00, 0x04, 0x0004 },
+ { 30, 0x0061, 0x00000041, 0x00, 0x02, 0x0000 },
+ { 30, 0x0041, 0x00000041, 0x01, 0x02, 0x0000 },
+ { 30, 0x0061, 0x00000041, 0x02, 0x02, 0x0000 },
+ { 30, 0x0041, 0x00000041, 0x03, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x04, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x05, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x06, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x07, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x08, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x09, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x0a, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x0b, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0c, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0d, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0e, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0f, 0x02, 0x0000 },
+ { 31, 0x0073, 0x00000053, 0x00, 0x02, 0x0000 },
+ { 31, 0x0053, 0x00000053, 0x01, 0x02, 0x0000 },
+ { 31, 0x0073, 0x00000053, 0x02, 0x02, 0x0000 },
+ { 31, 0x0053, 0x00000053, 0x03, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x04, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x05, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x06, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x07, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x08, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x09, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x0a, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x0b, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0c, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0d, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0e, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0f, 0x02, 0x0000 },
+ { 32, 0x0064, 0x00000044, 0x00, 0x02, 0x0000 },
+ { 32, 0x0044, 0x00000044, 0x01, 0x02, 0x0000 },
+ { 32, 0x0064, 0x00000044, 0x02, 0x02, 0x0000 },
+ { 32, 0x0044, 0x00000044, 0x03, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x04, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x05, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x06, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x07, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x08, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x09, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x0a, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x0b, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0c, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0d, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0e, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0f, 0x02, 0x0000 },
+ { 33, 0x0066, 0x00000046, 0x00, 0x02, 0x0000 },
+ { 33, 0x0046, 0x00000046, 0x01, 0x02, 0x0000 },
+ { 33, 0x0066, 0x00000046, 0x02, 0x02, 0x0000 },
+ { 33, 0x0046, 0x00000046, 0x03, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x04, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x05, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x06, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x07, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x08, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x09, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x0a, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x0b, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0c, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0d, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0e, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0f, 0x02, 0x0000 },
+ { 34, 0x0067, 0x00000047, 0x00, 0x02, 0x0000 },
+ { 34, 0x0047, 0x00000047, 0x01, 0x02, 0x0000 },
+ { 34, 0x0067, 0x00000047, 0x02, 0x02, 0x0000 },
+ { 34, 0x0047, 0x00000047, 0x03, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x04, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x05, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x06, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x07, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x08, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x09, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x0a, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x0b, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0c, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0d, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0e, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0f, 0x02, 0x0000 },
+ { 35, 0x0068, 0x00000048, 0x00, 0x02, 0x0000 },
+ { 35, 0x0048, 0x00000048, 0x01, 0x02, 0x0000 },
+ { 35, 0x0068, 0x00000048, 0x02, 0x02, 0x0000 },
+ { 35, 0x0048, 0x00000048, 0x03, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x04, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x05, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x06, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x07, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x08, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x09, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x0a, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x0b, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0c, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0d, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0e, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0f, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0000004a, 0x00, 0x02, 0x0000 },
+ { 36, 0x004a, 0x0000004a, 0x01, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0000004a, 0x02, 0x02, 0x0000 },
+ { 36, 0x004a, 0x0000004a, 0x03, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x04, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x05, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x06, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x07, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x08, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x09, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x0a, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x0b, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0c, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0d, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0e, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0f, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0000004b, 0x00, 0x02, 0x0000 },
+ { 37, 0x004b, 0x0000004b, 0x01, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0000004b, 0x02, 0x02, 0x0000 },
+ { 37, 0x004b, 0x0000004b, 0x03, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x04, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x05, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x06, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x07, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x08, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x09, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x0a, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x0b, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0c, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0d, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0e, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0f, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0000004c, 0x00, 0x02, 0x0000 },
+ { 38, 0x004c, 0x0000004c, 0x01, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0000004c, 0x02, 0x02, 0x0000 },
+ { 38, 0x004c, 0x0000004c, 0x03, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x04, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x05, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x06, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x07, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x08, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x09, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x0a, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x0b, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0c, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0d, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0e, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0f, 0x02, 0x0000 },
+ { 39, 0x003b, 0x0000003b, 0x00, 0x00, 0x0000 },
+ { 39, 0x003a, 0x0000003a, 0x01, 0x00, 0x0000 },
+ { 40, 0x0027, 0x00000027, 0x00, 0x00, 0x0000 },
+ { 40, 0x0022, 0x00000022, 0x01, 0x00, 0x0000 },
+ { 40, 0x0027, 0x01001251, 0x02, 0x01, 0x0000 },
+ { 40, 0x0022, 0x01001257, 0x03, 0x01, 0x0000 },
+ { 40, 0x0067, 0x04000047, 0x04, 0x00, 0x0000 },
+ { 41, 0x0060, 0x00000060, 0x00, 0x00, 0x0000 },
+ { 41, 0x007e, 0x0000007e, 0x01, 0x00, 0x0000 },
+ { 41, 0x0060, 0x01001250, 0x02, 0x01, 0x0000 },
+ { 41, 0x007e, 0x01001253, 0x03, 0x01, 0x0000 },
+ { 42, 0xffff, 0x01000020, 0x00, 0x04, 0x0001 },
+ { 43, 0x005c, 0x0000005c, 0x00, 0x00, 0x0000 },
+ { 43, 0x007c, 0x0000007c, 0x01, 0x00, 0x0000 },
+ { 43, 0x005c, 0x0400005c, 0x04, 0x00, 0x0000 },
+ { 44, 0x007a, 0x0000005a, 0x00, 0x02, 0x0000 },
+ { 44, 0x005a, 0x0000005a, 0x01, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0000005a, 0x02, 0x02, 0x0000 },
+ { 44, 0x005a, 0x0000005a, 0x03, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x04, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x05, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x06, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x07, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x08, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x09, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x0a, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x0b, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0c, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0d, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0e, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0f, 0x02, 0x0000 },
+ { 45, 0x0078, 0x00000058, 0x00, 0x02, 0x0000 },
+ { 45, 0x0058, 0x00000058, 0x01, 0x02, 0x0000 },
+ { 45, 0x0078, 0x00000058, 0x02, 0x02, 0x0000 },
+ { 45, 0x0058, 0x00000058, 0x03, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x04, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x05, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x06, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x07, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x08, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x09, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x0a, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x0b, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0c, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0d, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0e, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0f, 0x02, 0x0000 },
+ { 46, 0x0063, 0x00000043, 0x00, 0x02, 0x0000 },
+ { 46, 0x0043, 0x00000043, 0x01, 0x02, 0x0000 },
+ { 46, 0x0063, 0x00000043, 0x02, 0x02, 0x0000 },
+ { 46, 0x0043, 0x00000043, 0x03, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x04, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x05, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x06, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x07, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x08, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x09, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x0a, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x0b, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0c, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0d, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0e, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0f, 0x02, 0x0000 },
+ { 47, 0x0076, 0x00000056, 0x00, 0x02, 0x0000 },
+ { 47, 0x0056, 0x00000056, 0x01, 0x02, 0x0000 },
+ { 47, 0x0076, 0x00000056, 0x02, 0x02, 0x0000 },
+ { 47, 0x0056, 0x00000056, 0x03, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x04, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x05, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x06, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x07, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x08, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x09, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x0a, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x0b, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0c, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0d, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0e, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0f, 0x02, 0x0000 },
+ { 48, 0x0062, 0x00000042, 0x00, 0x02, 0x0000 },
+ { 48, 0x0042, 0x00000042, 0x01, 0x02, 0x0000 },
+ { 48, 0x0062, 0x00000042, 0x02, 0x02, 0x0000 },
+ { 48, 0x0042, 0x00000042, 0x03, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x04, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x05, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x06, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x07, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x08, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x09, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x0a, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x0b, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0c, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0d, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0e, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0f, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0000004e, 0x00, 0x02, 0x0000 },
+ { 49, 0x004e, 0x0000004e, 0x01, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0000004e, 0x02, 0x02, 0x0000 },
+ { 49, 0x004e, 0x0000004e, 0x03, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x04, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x05, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x06, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x07, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x08, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x09, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x0a, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x0b, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0c, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0d, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0e, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0f, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0000004d, 0x00, 0x02, 0x0000 },
+ { 50, 0x004d, 0x0000004d, 0x01, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0000004d, 0x02, 0x02, 0x0000 },
+ { 50, 0x004d, 0x0000004d, 0x03, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x04, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x05, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x06, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x07, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x08, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x09, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x0a, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x0b, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0c, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0d, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0e, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0f, 0x02, 0x0000 },
+ { 51, 0x002c, 0x0000002c, 0x00, 0x00, 0x0000 },
+ { 51, 0x003c, 0x0000003c, 0x01, 0x00, 0x0000 },
+ { 51, 0x002c, 0x0100125b, 0x02, 0x01, 0x0000 },
+ { 52, 0x002e, 0x0000002e, 0x00, 0x00, 0x0000 },
+ { 52, 0x003e, 0x0000003e, 0x01, 0x00, 0x0000 },
+ { 52, 0xffff, 0x01001120, 0x02, 0x00, 0x0000 },
+ { 53, 0x002f, 0x0000002f, 0x00, 0x00, 0x0000 },
+ { 53, 0x003f, 0x0000003f, 0x01, 0x00, 0x0000 },
+ { 53, 0xffff, 0x01000003, 0x04, 0x00, 0x0000 },
+ { 54, 0xffff, 0x01000020, 0x00, 0x04, 0x0001 },
+ { 55, 0x002a, 0x2000002a, 0x00, 0x00, 0x0000 },
+ { 56, 0xffff, 0x01000023, 0x00, 0x04, 0x0008 },
+ { 57, 0x0020, 0x00000020, 0x00, 0x00, 0x0000 },
+ { 58, 0xffff, 0x01000024, 0x00, 0x00, 0x0000 },
+ { 59, 0xffff, 0x01000030, 0x00, 0x00, 0x0000 },
+ { 59, 0xffff, 0x0100003c, 0x01, 0x00, 0x0000 },
+ { 59, 0xffff, 0x01000048, 0x04, 0x00, 0x0000 },
+ { 59, 0xffff, 0x01000000, 0x0c, 0x08, 0x0100 },
+ { 60, 0xffff, 0x01000031, 0x00, 0x00, 0x0000 },
+ { 60, 0xffff, 0x0100003d, 0x01, 0x00, 0x0000 },
+ { 60, 0xffff, 0x01000049, 0x04, 0x00, 0x0000 },
+ { 60, 0xffff, 0x01000000, 0x0c, 0x08, 0x0101 },
+ { 61, 0xffff, 0x01000032, 0x00, 0x00, 0x0000 },
+ { 61, 0xffff, 0x0100003e, 0x01, 0x00, 0x0000 },
+ { 61, 0xffff, 0x0100004a, 0x04, 0x00, 0x0000 },
+ { 61, 0xffff, 0x01000000, 0x0c, 0x08, 0x0102 },
+ { 62, 0xffff, 0x01000033, 0x00, 0x00, 0x0000 },
+ { 62, 0xffff, 0x0100003f, 0x01, 0x00, 0x0000 },
+ { 62, 0xffff, 0x0100004b, 0x04, 0x00, 0x0000 },
+ { 62, 0xffff, 0x01000000, 0x0c, 0x08, 0x0103 },
+ { 63, 0xffff, 0x01000034, 0x00, 0x00, 0x0000 },
+ { 63, 0xffff, 0x01000040, 0x01, 0x00, 0x0000 },
+ { 63, 0xffff, 0x0100004c, 0x04, 0x00, 0x0000 },
+ { 63, 0xffff, 0x01000000, 0x0c, 0x08, 0x0104 },
+ { 64, 0xffff, 0x01000035, 0x00, 0x00, 0x0000 },
+ { 64, 0xffff, 0x01000041, 0x01, 0x00, 0x0000 },
+ { 64, 0xffff, 0x0100004d, 0x04, 0x00, 0x0000 },
+ { 64, 0xffff, 0x01000000, 0x0c, 0x08, 0x0105 },
+ { 65, 0xffff, 0x01000036, 0x00, 0x00, 0x0000 },
+ { 65, 0xffff, 0x01000042, 0x01, 0x00, 0x0000 },
+ { 65, 0xffff, 0x0100004e, 0x04, 0x00, 0x0000 },
+ { 65, 0xffff, 0x01000000, 0x0c, 0x08, 0x0106 },
+ { 66, 0xffff, 0x01000037, 0x00, 0x00, 0x0000 },
+ { 66, 0xffff, 0x01000043, 0x01, 0x00, 0x0000 },
+ { 66, 0xffff, 0x0100004f, 0x04, 0x00, 0x0000 },
+ { 66, 0xffff, 0x01000000, 0x0c, 0x08, 0x0107 },
+ { 67, 0xffff, 0x01000038, 0x00, 0x00, 0x0000 },
+ { 67, 0xffff, 0x01000044, 0x01, 0x00, 0x0000 },
+ { 67, 0xffff, 0x01000050, 0x04, 0x00, 0x0000 },
+ { 67, 0xffff, 0x01000000, 0x0c, 0x08, 0x0108 },
+ { 68, 0xffff, 0x01000039, 0x00, 0x00, 0x0000 },
+ { 68, 0xffff, 0x01000045, 0x01, 0x00, 0x0000 },
+ { 68, 0xffff, 0x01000051, 0x04, 0x00, 0x0000 },
+ { 68, 0xffff, 0x01000000, 0x0c, 0x08, 0x0109 },
+ { 69, 0xffff, 0x01000025, 0x00, 0x00, 0x0000 },
+ { 70, 0xffff, 0x01000026, 0x00, 0x00, 0x0000 },
+ { 70, 0xffff, 0x01000026, 0x08, 0x00, 0x0000 },
+ { 71, 0x0037, 0x20000037, 0x00, 0x00, 0x0000 },
+ { 72, 0x0038, 0x20000038, 0x00, 0x00, 0x0000 },
+ { 73, 0x0039, 0x20000039, 0x00, 0x00, 0x0000 },
+ { 74, 0x002d, 0x2000002d, 0x00, 0x00, 0x0000 },
+ { 75, 0x0034, 0x20000034, 0x00, 0x00, 0x0000 },
+ { 76, 0x0035, 0x20000035, 0x00, 0x00, 0x0000 },
+ { 77, 0x0036, 0x20000036, 0x00, 0x00, 0x0000 },
+ { 78, 0x002b, 0x2000002b, 0x00, 0x00, 0x0000 },
+ { 79, 0x0031, 0x20000031, 0x00, 0x00, 0x0000 },
+ { 80, 0x0032, 0x20000032, 0x00, 0x00, 0x0000 },
+ { 81, 0x0033, 0x20000033, 0x00, 0x00, 0x0000 },
+ { 82, 0x0030, 0x20000030, 0x00, 0x00, 0x0000 },
+ { 83, 0x002e, 0x2000002e, 0x00, 0x00, 0x0000 },
+ { 83, 0xffff, 0x01000000, 0x06, 0x08, 0x0200 },
+ { 83, 0xffff, 0x01000000, 0x0c, 0x08, 0x0200 },
+ { 86, 0x003c, 0x0000003c, 0x00, 0x00, 0x0000 },
+ { 86, 0x003e, 0x0000003e, 0x01, 0x00, 0x0000 },
+ { 86, 0x007c, 0x0000007c, 0x02, 0x00, 0x0000 },
+ { 87, 0xffff, 0x0100003a, 0x00, 0x00, 0x0000 },
+ { 87, 0xffff, 0x01000046, 0x01, 0x00, 0x0000 },
+ { 87, 0xffff, 0x01000052, 0x04, 0x00, 0x0000 },
+ { 87, 0xffff, 0x01000000, 0x0c, 0x08, 0x010a },
+ { 88, 0xffff, 0x0100003b, 0x00, 0x00, 0x0000 },
+ { 88, 0xffff, 0x01000047, 0x01, 0x00, 0x0000 },
+ { 88, 0xffff, 0x01000000, 0x0c, 0x08, 0x010b },
+ { 96, 0xffff, 0x21000005, 0x00, 0x00, 0x0000 },
+ { 97, 0xffff, 0x01000021, 0x00, 0x04, 0x0004 },
+ { 98, 0x002f, 0x2000002f, 0x00, 0x00, 0x0000 },
+ { 99, 0x005c, 0x0400005c, 0x00, 0x00, 0x0000 },
+ { 100, 0xffff, 0x01001103, 0x00, 0x04, 0x0002 },
+ { 102, 0xffff, 0x01000010, 0x00, 0x00, 0x0000 },
+ { 103, 0xffff, 0x01000013, 0x00, 0x00, 0x0000 },
+ { 104, 0xffff, 0x01000016, 0x00, 0x00, 0x0000 },
+ { 105, 0xffff, 0x01000012, 0x00, 0x00, 0x0000 },
+ { 105, 0xffff, 0x01000000, 0x0c, 0x08, 0x0180 },
+ { 106, 0xffff, 0x01000014, 0x00, 0x00, 0x0000 },
+ { 106, 0xffff, 0x01000000, 0x0c, 0x08, 0x0181 },
+ { 107, 0xffff, 0x01000011, 0x00, 0x00, 0x0000 },
+ { 108, 0xffff, 0x01000015, 0x00, 0x00, 0x0000 },
+ { 109, 0xffff, 0x01000017, 0x00, 0x00, 0x0000 },
+ { 110, 0xffff, 0x01000006, 0x00, 0x00, 0x0000 },
+ { 111, 0xffff, 0x01000007, 0x00, 0x00, 0x0000 },
+ { 111, 0xffff, 0x01000000, 0x06, 0x08, 0x0200 },
+ { 111, 0xffff, 0x01000000, 0x0c, 0x08, 0x0200 },
+};
+
+const QKeyboardMap::Composing QVxKeyboardHandler::s_keycompose_default[] = {
+ { 0x0060, 0x0041, 0x00c0 },
+ { 0x0060, 0x0061, 0x00e0 },
+ { 0x0027, 0x0041, 0x00c1 },
+ { 0x0027, 0x0061, 0x00e1 },
+ { 0x005e, 0x0041, 0x00c2 },
+ { 0x005e, 0x0061, 0x00e2 },
+ { 0x007e, 0x0041, 0x00c3 },
+ { 0x007e, 0x0061, 0x00e3 },
+ { 0x0022, 0x0041, 0x00c4 },
+ { 0x0022, 0x0061, 0x00e4 },
+ { 0x002d, 0x0061, 0x00aa },
+ { 0x002d, 0x0041, 0x00aa },
+ { 0x004f, 0x0041, 0x00c5 },
+ { 0x006f, 0x0061, 0x00e5 },
+ { 0x0030, 0x0041, 0x00c5 },
+ { 0x0030, 0x0061, 0x00e5 },
+ { 0x0041, 0x0041, 0x00c5 },
+ { 0x0061, 0x0061, 0x00e5 },
+ { 0x00b0, 0x0041, 0x00c5 },
+ { 0x00b0, 0x0061, 0x00e5 },
+ { 0x0041, 0x0045, 0x00c6 },
+ { 0x0061, 0x0065, 0x00e6 },
+ { 0x002c, 0x0043, 0x00c7 },
+ { 0x002c, 0x0063, 0x00e7 },
+ { 0x005e, 0x0043, 0x00c7 },
+ { 0x005e, 0x0063, 0x00e7 },
+ { 0x0060, 0x0045, 0x00c8 },
+ { 0x0060, 0x0065, 0x00e8 },
+ { 0x0027, 0x0045, 0x00c9 },
+ { 0x0027, 0x0065, 0x00e9 },
+ { 0x005e, 0x0045, 0x00ca },
+ { 0x005e, 0x0065, 0x00ea },
+ { 0x0022, 0x0045, 0x00cb },
+ { 0x0022, 0x0065, 0x00eb },
+ { 0x0060, 0x0049, 0x00cc },
+ { 0x0060, 0x0069, 0x00ec },
+ { 0x0027, 0x0049, 0x00cd },
+ { 0x0027, 0x0069, 0x00ed },
+ { 0x005e, 0x0049, 0x00ce },
+ { 0x005e, 0x0069, 0x00ee },
+ { 0x0022, 0x0049, 0x00cf },
+ { 0x0022, 0x0069, 0x00ef },
+ { 0x002d, 0x0044, 0x00d0 },
+ { 0x002d, 0x0064, 0x00f0 },
+ { 0x005e, 0x0044, 0x00d0 },
+ { 0x005e, 0x0064, 0x00f0 },
+ { 0x007e, 0x004e, 0x00d1 },
+ { 0x007e, 0x006e, 0x00f1 },
+ { 0x005e, 0x004e, 0x00d1 },
+ { 0x005e, 0x006e, 0x00f1 },
+ { 0x0060, 0x004f, 0x00d2 },
+ { 0x0060, 0x006f, 0x00f2 },
+ { 0x0027, 0x004f, 0x00d3 },
+ { 0x0027, 0x006f, 0x00f3 },
+ { 0x005e, 0x004f, 0x00d4 },
+ { 0x005e, 0x006f, 0x00f4 },
+ { 0x007e, 0x004f, 0x00d5 },
+ { 0x007e, 0x006f, 0x00f5 },
+ { 0x0022, 0x004f, 0x00d6 },
+ { 0x0022, 0x006f, 0x00f6 },
+ { 0x002f, 0x004f, 0x00d8 },
+ { 0x002f, 0x006f, 0x00f8 },
+ { 0x002d, 0x006f, 0x00ba },
+ { 0x002d, 0x004f, 0x00ba },
+ { 0x0060, 0x0055, 0x00d9 },
+ { 0x0060, 0x0075, 0x00f9 },
+ { 0x0027, 0x0055, 0x00da },
+ { 0x0027, 0x0075, 0x00fa },
+ { 0x005e, 0x0055, 0x00db },
+ { 0x005e, 0x0075, 0x00fb },
+ { 0x0022, 0x0055, 0x00dc },
+ { 0x0022, 0x0075, 0x00fc },
+ { 0x0027, 0x0059, 0x00dd },
+ { 0x0027, 0x0079, 0x00fd },
+ { 0x0054, 0x0048, 0x00de },
+ { 0x0074, 0x0068, 0x00fe },
+ { 0x0073, 0x0073, 0x00df },
+ { 0x0022, 0x0079, 0x00ff },
+ { 0x0073, 0x007a, 0x00df },
+ { 0x006e, 0x006e, 0x00f1 },
+ { 0x006e, 0x0068, 0x00f1 },
+ { 0x004e, 0x0059, 0x00d1 },
+ { 0x004e, 0x004e, 0x00d1 },
+ { 0x004e, 0x0048, 0x00d1 },
+ { 0x004e, 0x0079, 0x00d1 },
+ { 0x004e, 0x006e, 0x00d1 },
+ { 0x004e, 0x0068, 0x00d1 },
+ { 0x002d, 0x004c, 0x00a3 },
+ { 0x003c, 0x003c, 0x00ab },
+ { 0x003e, 0x003e, 0x00bb },
+ { 0x003f, 0x003f, 0x00bf },
+ { 0x005e, 0x003f, 0x00bf },
+ { 0x0021, 0x0021, 0x00a1 },
+ { 0x005e, 0x0021, 0x00a1 },
+ { 0x005e, 0x0031, 0x00b9 },
+ { 0x005e, 0x0032, 0x00b2 },
+ { 0x005e, 0x0033, 0x00b3 },
+ { 0x002b, 0x002d, 0x00b1 },
+ { 0x0063, 0x003d, 0x00a2 },
+ { 0x0063, 0x002f, 0x00a2 },
+ { 0x002f, 0x0063, 0x00a2 },
+ { 0x002d, 0x0063, 0x00a2 },
+ { 0x002d, 0x0043, 0x00a2 },
+ { 0x004c, 0x003d, 0x00a3 },
+ { 0x002d, 0x004c, 0x00a3 },
+ { 0x002d, 0x006c, 0x00a3 },
+ { 0x005e, 0x002a, 0x00d7 },
+ { 0x005e, 0x0078, 0x00d7 },
+ { 0x0078, 0x0078, 0x00d7 },
+ { 0x005e, 0x002e, 0x00b7 },
+ { 0x002e, 0x002e, 0x00b7 },
+ { 0x005e, 0x002f, 0x00f7 },
+ { 0x005e, 0x003a, 0x00f7 },
+ { 0x002d, 0x003a, 0x00f7 },
+ { 0x003a, 0x002d, 0x00f7 },
+ { 0x0059, 0x003d, 0x00a5 },
+ { 0x002d, 0x0059, 0x00a5 },
+ { 0x002d, 0x006c, 0x00a5 },
+ { 0x0028, 0x0063, 0x00a9 },
+ { 0x0022, 0x0063, 0x00a9 },
+ { 0x002d, 0x0061, 0x00aa },
+ { 0x002d, 0x0041, 0x00aa },
+ { 0x002d, 0x006f, 0x00ba },
+ { 0x002d, 0x004f, 0x00ba },
+ { 0x0028, 0x0072, 0x00ae },
+ { 0x0022, 0x0072, 0x00ae },
+ { 0x006d, 0x0075, 0x00b5 },
+ { 0x0031, 0x0034, 0x0152 },
+ { 0x0031, 0x0032, 0x0153 },
+ { 0x0033, 0x0034, 0x0178 },
+ { 0x0065, 0x003d, 0x20ac },
+ { 0x002d, 0x0065, 0x20ac },
+ { 0x002d, 0x0045, 0x20ac },
+ { 0x0076, 0x0053, 0x0160 },
+ { 0x005e, 0x0053, 0x0160 },
+ { 0x0076, 0x0073, 0x0161 },
+ { 0x005e, 0x0073, 0x0161 },
+ { 0x0076, 0x005a, 0x017d },
+ { 0x005e, 0x005a, 0x017d },
+ { 0x0076, 0x007a, 0x017e },
+ { 0x005e, 0x007a, 0x017e },
+ { 0x004f, 0x0045, 0x0152 },
+ { 0x004f, 0x0065, 0x0152 },
+ { 0x006f, 0x0065, 0x0153 },
+ { 0x0022, 0x0059, 0x0178 },
+ { 0x0069, 0x006a, 0x00ff },
+ { 0x0049, 0x004a, 0x0178 },
+};
+
+#endif // QVXKEYBOARDHANDLER_DEFAULTMAP_P_H
diff --git a/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler.cpp b/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler.cpp
new file mode 100644
index 00000000000..d2de1cacaa0
--- /dev/null
+++ b/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler.cpp
@@ -0,0 +1,492 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qvxkeyboardhandler_p.h"
+#include "qoutputmapping_p.h"
+
+#include <qplatformdefs.h>
+
+#include <QFile>
+#include <QSocketNotifier>
+#include <QStringList>
+#include <QCoreApplication>
+#include <QLoggingCategory>
+#include <qpa/qwindowsysteminterface.h>
+#include <private/qcore_unix_p.h>
+
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qinputdevicemanager_p.h>
+
+#include <evdevLib.h>
+
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#endif
+
+#ifndef input_event_usec
+#define input_event_usec time.tv_usec
+#endif
+
+QT_BEGIN_NAMESPACE
+
+using namespace Qt::StringLiterals;
+
+Q_LOGGING_CATEGORY(qLcVxKey, "qt.qpa.input")
+Q_STATIC_LOGGING_CATEGORY(qLcVxKeyMap, "qt.qpa.input.keymap")
+
+// simple builtin US keymap
+#include "qvxkeyboard_defaultmap_p.h"
+
+QVxKeyboardHandler::QVxKeyboardHandler(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_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(qLcVxKey) << "Create keyboard handler with for device" << device;
+
+ setObjectName("VxWorksInput Keyboard Handler"_L1);
+
+ memset(m_locks, 0, sizeof(m_locks));
+
+ if (keymapFile.isEmpty() || !loadKeymap(keymapFile))
+ unloadKeymap();
+
+ // socket notifier for events on the keyboard device
+ m_notify = new QSocketNotifier(m_fd.get(), QSocketNotifier::Read, this);
+ connect(m_notify, &QSocketNotifier::activated, this, &QVxKeyboardHandler::readKeycode);
+}
+
+QVxKeyboardHandler::~QVxKeyboardHandler()
+{
+ unloadKeymap();
+}
+
+std::unique_ptr<QVxKeyboardHandler> QVxKeyboardHandler::create(const QString &device,
+ const QString &specification,
+ const QString &defaultKeymapFile)
+{
+ qCDebug(qLcVxKey, "Try to create keyboard handler for \"%ls\" \"%ls\"",
+ qUtf16Printable(device), qUtf16Printable(specification));
+
+ QString keymapFile = defaultKeymapFile;
+ int repeatDelay = 400;
+ int repeatRate = 80;
+ bool disableZap = false;
+ bool enableCompose = false;
+ int grab = 0;
+
+ const auto args = QStringView{specification}.split(u':');
+ for (const auto &arg : args) {
+ if (arg.startsWith("keymap="_L1))
+ keymapFile = arg.mid(7).toString();
+ else if (arg == "disable-zap"_L1)
+ disableZap = true;
+ else if (arg == "enable-compose"_L1)
+ enableCompose = true;
+ else if (arg.startsWith("repeat-delay="_L1))
+ repeatDelay = arg.mid(13).toInt();
+ else if (arg.startsWith("repeat-rate="_L1))
+ repeatRate = arg.mid(12).toInt();
+ else if (arg.startsWith("grab="_L1))
+ grab = arg.mid(5).toInt();
+ }
+
+ qCDebug(qLcVxKey, "Opening keyboard at %ls", qUtf16Printable(device));
+
+ QFdContainer fd(qt_safe_open(device.toLocal8Bit().constData(), O_RDWR | O_NDELAY, 0));
+ if (fd.get() < 0) {
+ qCDebug(qLcVxKey, "Keyboard device could not be opened as read-write, trying read-only");
+ fd.reset(qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0));
+ }
+ if (fd.get() >= 0) {
+ UINT32 kbdMode = EV_DEV_KBD_KEYCODE_MODE;
+ if (ERROR == ioctl (fd.get(), EV_DEV_IO_SET_KBD_MODE, (char *)&kbdMode)) {
+ qWarning("Cannot set keyboard mapping mode to KEYCODE mode: %s", strerror(errno));
+ return nullptr;
+ }
+
+ return std::unique_ptr<QVxKeyboardHandler>(new QVxKeyboardHandler(device, fd, disableZap, enableCompose, keymapFile));
+ } else {
+ qErrnoWarning("Cannot open keyboard input device '%ls'", qUtf16Printable(device));
+ return nullptr;
+ }
+}
+
+void QVxKeyboardHandler::readKeycode()
+{
+ EV_DEV_EVENT ev;
+ int n = ERROR;
+
+ while (n == ERROR) {
+ n = qt_safe_read(m_fd.get(), (char *)(&ev), sizeof(EV_DEV_EVENT));
+
+ if (n == 0) {
+ qWarning("vxkeyboard: Got EOF from the input device");
+ return;
+ }
+
+ if (n == ERROR) {
+ if (errno == EINTR || errno == EAGAIN)
+ continue;
+
+ qErrnoWarning("vxkeyboard: Could not read from input device");
+ if (errno == ENXIO) {
+ delete m_notify;
+ m_notify = nullptr;
+ m_fd.reset();
+ }
+ return;
+ }
+ }
+
+ if (n < sizeof(EV_DEV_EVENT)) return;
+ if (ev.type != EV_DEV_KEY) return;
+
+ quint16 code = ev.code;
+ qint32 value = ev.value;
+
+ processKeycode(code, value != 0, value == 2);
+}
+
+void QVxKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtcode,
+ Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
+{
+ if (!autoRepeat)
+ QGuiApplicationPrivate::inputDeviceManager()->setKeyboardModifiers(QVxKeyboardHandler::toQtModifiers(m_modifiers));
+
+ QWindow *window = nullptr;
+ QWindowSystemInterface::handleExtendedKeyEvent(window, (isPress ? QEvent::KeyPress : QEvent::KeyRelease),
+ qtcode, modifiers, nativecode + 8, 0, int(modifiers),
+ (unicode != 0xffff ) ? QString(QChar(unicode)) : QString(), autoRepeat);
+}
+
+QKeycodeAction QVxKeyboardHandler::processKeycode(quint16 keycode, bool pressed, bool autorepeat)
+{
+ QKeycodeAction result = QKeycodeAction::None;
+ bool first_press = pressed && !autorepeat;
+
+ const QKeyboardMap::Mapping *map_plain = nullptr;
+ const QKeyboardMap::Mapping *map_withmod = nullptr;
+
+ quint8 modifiers = m_modifiers;
+
+ // get a specific and plain mapping for the keycode and the current modifiers
+ for (int i = 0; i < m_keymap_size && !(map_plain && map_withmod); ++i) {
+ const QKeyboardMap::Mapping *m = m_keymap + i;
+ if (m->keycode == keycode) {
+ if (m->modifiers == 0)
+ map_plain = m;
+
+ quint8 testmods = m_modifiers;
+ if (m_locks[0] /*CapsLock*/ && (m->flags & QKeyboardMap::IsLetter))
+ testmods ^= QKeyboardMap::ModShift;
+ if (m_langLock)
+ testmods ^= QKeyboardMap::ModAltGr;
+ if (m->modifiers == testmods)
+ map_withmod = m;
+ }
+ }
+
+ if (m_locks[0] && map_withmod && (map_withmod->flags & QKeyboardMap::IsLetter))
+ modifiers ^= QKeyboardMap::ModShift;
+
+ qCDebug(qLcVxKeyMap, "Processing key event: keycode=%3d, modifiers=%02x pressed=%d, autorepeat=%d | plain=%d, withmod=%d, size=%d",
+ keycode, modifiers, pressed ? 1 : 0, autorepeat ? 1 : 0,
+ int(map_plain ? map_plain - m_keymap : -1),
+ int(map_withmod ? map_withmod - m_keymap : -1),
+ m_keymap_size);
+
+ const QKeyboardMap::Mapping *it = map_withmod ? map_withmod : map_plain;
+
+ if (!it) {
+ // we couldn't even find a plain mapping
+ qCDebug(qLcVxKeyMap, "Could not find a suitable mapping for keycode: %3d, modifiers: %02x", keycode, modifiers);
+ return result;
+ }
+
+ bool skip = false;
+ quint16 unicode = it->unicode;
+ quint32 qtcode = it->qtcode;
+
+ if ((it->flags & QKeyboardMap::IsModifier) && it->special) {
+ // this is a modifier, i.e. Shift, Alt, ...
+ if (pressed)
+ m_modifiers |= quint8(it->special);
+ else
+ m_modifiers &= ~quint8(it->special);
+ } else if (qtcode >= Qt::Key_CapsLock && qtcode <= Qt::Key_ScrollLock) {
+ // (Caps|Num|Scroll)Lock
+ if (first_press) {
+ quint8 &lock = m_locks[qtcode - Qt::Key_CapsLock];
+ lock ^= 1;
+
+ switch (qtcode) {
+ case Qt::Key_CapsLock : result = lock ? QKeycodeAction::CapsLockOn : QKeycodeAction::CapsLockOff; break;
+ case Qt::Key_NumLock : result = lock ? QKeycodeAction::NumLockOn : QKeycodeAction::NumLockOff; break;
+ case Qt::Key_ScrollLock: result = lock ? QKeycodeAction::ScrollLockOn : QKeycodeAction::ScrollLockOff; break;
+ default : break;
+ }
+ }
+ } else if ((it->flags & QKeyboardMap::IsSystem) && it->special && first_press) {
+ switch (it->special) {
+ case QKeyboardMap::SystemReboot:
+ result = QKeycodeAction::Reboot;
+ break;
+
+ case QKeyboardMap::SystemZap:
+ if (!m_no_zap)
+ qApp->quit();
+ break;
+
+ case QKeyboardMap::SystemConsolePrevious:
+ result = QKeycodeAction::PreviousConsole;
+ break;
+
+ case QKeyboardMap::SystemConsoleNext:
+ result = QKeycodeAction::NextConsole;
+ break;
+
+ default:
+ if (it->special >= QKeyboardMap::SystemConsoleFirst &&
+ it->special <= QKeyboardMap::SystemConsoleLast) {
+ result = QKeycodeAction(
+ static_cast<int>(QKeycodeAction::SwitchConsoleFirst)
+ + ((it->special & static_cast<int>(QKeyboardMap::SystemConsoleMask))
+ & static_cast<int>(QKeycodeAction::SwitchConsoleMask)));
+ }
+ break;
+ }
+
+ skip = true; // no need to tell Qt about it
+ } else if ((qtcode == Qt::Key_Multi_key) && m_do_compose) {
+ // the Compose key was pressed
+ if (first_press)
+ m_composing = 2;
+ skip = true;
+ } else if ((it->flags & QKeyboardMap::IsDead) && m_do_compose) {
+ // a Dead key was pressed
+ if (first_press && m_composing == 1 && m_dead_unicode == unicode) { // twice
+ m_composing = 0;
+ qtcode = Qt::Key_unknown; // otherwise it would be Qt::Key_Dead...
+ } else if (first_press && unicode != 0xffff) {
+ m_dead_unicode = unicode;
+ m_composing = 1;
+ skip = true;
+ } else {
+ skip = true;
+ }
+ }
+
+ if (!skip) {
+ // a normal key was pressed
+ const int modmask = Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier;
+
+ // we couldn't find a specific mapping for the current modifiers,
+ // or that mapping didn't have special modifiers:
+ // so just report the plain mapping with additional modifiers.
+ if ((it == map_plain && it != map_withmod) ||
+ (map_withmod && !(map_withmod->qtcode & modmask))) {
+ qtcode |= QVxKeyboardHandler::toQtModifiers(modifiers);
+ }
+
+ if (m_composing == 2 && first_press && !(it->flags & QKeyboardMap::IsModifier)) {
+ // the last key press was the Compose key
+ if (unicode != 0xffff) {
+ int idx = 0;
+ // check if this code is in the compose table at all
+ for ( ; idx < m_keycompose_size; ++idx) {
+ if (m_keycompose[idx].first == unicode)
+ break;
+ }
+ if (idx < m_keycompose_size) {
+ // found it -> simulate a Dead key press
+ m_dead_unicode = unicode;
+ unicode = 0xffff;
+ m_composing = 1;
+ skip = true;
+ } else {
+ m_composing = 0;
+ }
+ } else {
+ m_composing = 0;
+ }
+ } else if (m_composing == 1 && first_press && !(it->flags & QKeyboardMap::IsModifier)) {
+ // the last key press was a Dead key
+ bool valid = false;
+ if (unicode != 0xffff) {
+ int idx = 0;
+ // check if this code is in the compose table at all
+ for ( ; idx < m_keycompose_size; ++idx) {
+ if (m_keycompose[idx].first == m_dead_unicode && m_keycompose[idx].second == unicode)
+ break;
+ }
+ if (idx < m_keycompose_size) {
+ quint16 composed = m_keycompose[idx].result;
+ if (composed != 0xffff) {
+ unicode = composed;
+ qtcode = Qt::Key_unknown;
+ valid = true;
+ }
+ }
+ }
+ if (!valid) {
+ unicode = m_dead_unicode;
+ qtcode = Qt::Key_unknown;
+ }
+ m_composing = 0;
+ }
+
+ if (!skip) {
+ // Up until now qtcode contained both the key and modifiers. Split it.
+ Qt::KeyboardModifiers qtmods = Qt::KeyboardModifiers(qtcode & modmask);
+ qtcode &= ~modmask;
+
+ // qtmods here is the modifier state before the event, i.e. not
+ // including the current key in case it is a modifier.
+ qCDebug(qLcVxKeyMap, "Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode, int(qtmods));
+
+ // If NumLockOff and keypad key pressed remap event sent
+ if (!m_locks[1] && (qtmods & Qt::KeypadModifier) &&
+ keycode >= 71 &&
+ keycode <= 83 &&
+ keycode != 74 &&
+ keycode != 78) {
+
+ unicode = 0xffff;
+ switch (keycode) {
+ case 71: //7 --> Home
+ qtcode = Qt::Key_Home;
+ break;
+ case 72: //8 --> Up
+ qtcode = Qt::Key_Up;
+ break;
+ case 73: //9 --> PgUp
+ qtcode = Qt::Key_PageUp;
+ break;
+ case 75: //4 --> Left
+ qtcode = Qt::Key_Left;
+ break;
+ case 76: //5 --> Clear
+ qtcode = Qt::Key_Clear;
+ break;
+ case 77: //6 --> right
+ qtcode = Qt::Key_Right;
+ break;
+ case 79: //1 --> End
+ qtcode = Qt::Key_End;
+ break;
+ case 80: //2 --> Down
+ qtcode = Qt::Key_Down;
+ break;
+ case 81: //3 --> PgDn
+ qtcode = Qt::Key_PageDown;
+ break;
+ case 82: //0 --> Ins
+ qtcode = Qt::Key_Insert;
+ break;
+ case 83: //, --> Del
+ qtcode = Qt::Key_Delete;
+ break;
+ }
+ }
+
+ // Map SHIFT + Tab to SHIFT + Backtab, QShortcutMap knows about this translation
+ if (qtcode == Qt::Key_Tab && (qtmods & Qt::ShiftModifier) == Qt::ShiftModifier)
+ qtcode = Qt::Key_Backtab;
+
+ // Generate the QPA event.
+ processKeyEvent(keycode, unicode, qtcode, qtmods, pressed, autorepeat);
+ }
+ }
+ return result;
+}
+
+void QVxKeyboardHandler::unloadKeymap()
+{
+ qCDebug(qLcVxKey, "Unload current keymap and restore built-in");
+
+ if (m_keymap && m_keymap != s_keymap_default)
+ delete [] m_keymap;
+ if (m_keycompose && m_keycompose != s_keycompose_default)
+ delete [] m_keycompose;
+
+ m_keymap = s_keymap_default;
+ m_keymap_size = sizeof(s_keymap_default) / sizeof(s_keymap_default[0]);
+ m_keycompose = s_keycompose_default;
+ m_keycompose_size = sizeof(s_keycompose_default) / sizeof(s_keycompose_default[0]);
+
+ // reset state, so we could switch keymaps at runtime
+ m_modifiers = 0;
+ memset(m_locks, 0, sizeof(m_locks));
+ m_composing = 0;
+ m_dead_unicode = 0xffff;
+
+ m_langLock = 0;
+}
+
+bool QVxKeyboardHandler::loadKeymap(const QString &file)
+{
+ qCDebug(qLcVxKey, "Loading keymap %ls", qUtf16Printable(file));
+
+ QFile f(file);
+
+ if (!f.open(QIODevice::ReadOnly)) {
+ qWarning("Could not open keymap file '%ls'", qUtf16Printable(file));
+ return false;
+ }
+
+ // .qmap files have a very simple structure:
+ // quint32 magic (QKeyboard::FileMagic)
+ // quint32 version (1)
+ // quint32 keymap_size (# of struct QKeyboard::Mappings)
+ // quint32 keycompose_size (# of struct QKeyboard::Composings)
+ // all QKeyboard::Mappings via QDataStream::operator(<<|>>)
+ // all QKeyboard::Composings via QDataStream::operator(<<|>>)
+
+ quint32 qmap_magic, qmap_version, qmap_keymap_size, qmap_keycompose_size;
+
+ QDataStream ds(&f);
+
+ ds >> qmap_magic >> qmap_version >> qmap_keymap_size >> qmap_keycompose_size;
+
+ if (ds.status() != QDataStream::Ok || qmap_magic != QKeyboardMap::FileMagic || qmap_version != 1 || qmap_keymap_size == 0) {
+ qWarning("'%ls' is not a valid .qmap keymap file", qUtf16Printable(file));
+ return false;
+ }
+
+ QKeyboardMap::Mapping *qmap_keymap = new QKeyboardMap::Mapping[qmap_keymap_size];
+ QKeyboardMap::Composing *qmap_keycompose = qmap_keycompose_size ? new QKeyboardMap::Composing[qmap_keycompose_size] : 0;
+
+ for (quint32 i = 0; i < qmap_keymap_size; ++i)
+ ds >> qmap_keymap[i];
+ for (quint32 i = 0; i < qmap_keycompose_size; ++i)
+ ds >> qmap_keycompose[i];
+
+ if (ds.status() != QDataStream::Ok) {
+ delete [] qmap_keymap;
+ delete [] qmap_keycompose;
+
+ qWarning("Keymap file '%ls' cannot be loaded.", qUtf16Printable(file));
+ return false;
+ }
+
+ // unload currently active and clear state
+ unloadKeymap();
+
+ m_keymap = qmap_keymap;
+ m_keymap_size = qmap_keymap_size;
+ m_keycompose = qmap_keycompose;
+ m_keycompose_size = qmap_keycompose_size;
+
+ m_do_compose = true;
+
+ return true;
+}
+
+void QVxKeyboardHandler::switchLang()
+{
+ m_langLock ^= 1;
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler_p.h b/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler_p.h
new file mode 100644
index 00000000000..81a39fb39e8
--- /dev/null
+++ b/src/platformsupport/input/vxkeyboard/qvxkeyboardhandler_p.h
@@ -0,0 +1,167 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QVXKEYBOARDHANDLER_P_H
+#define QVXKEYBOARDHANDLER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qobject.h>
+#include <qloggingcategory.h>
+#include <QtInputSupport/private/qfdcontainer_p.h>
+#include <QtInputSupport/private/qkeyboardmap_p.h>
+#include <QtInputSupport/private/qkeycodeaction_p.h>
+
+#include <QDataStream>
+#include <private/qglobal_p.h>
+
+#include <memory>
+
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_LOGGING_CATEGORY(qLcVxKey)
+
+class QSocketNotifier;
+
+namespace QVxKeyboardMap {
+ const quint32 FileMagic = 0x514d4150; // 'QMAP'
+
+ struct Mapping {
+ quint16 keycode;
+ quint16 unicode;
+ quint32 qtcode;
+ quint8 modifiers;
+ quint8 flags;
+ quint16 special;
+
+ };
+
+ enum Flags {
+ IsDead = 0x01,
+ IsLetter = 0x02,
+ IsModifier = 0x04,
+ IsSystem = 0x08
+ };
+
+ enum System {
+ SystemConsoleFirst = 0x0100,
+ SystemConsoleMask = 0x007f,
+ SystemConsoleLast = 0x017f,
+ SystemConsolePrevious = 0x0180,
+ SystemConsoleNext = 0x0181,
+ SystemReboot = 0x0200,
+ SystemZap = 0x0300
+ };
+
+ struct Composing {
+ quint16 first;
+ quint16 second;
+ quint16 result;
+ };
+
+ enum Modifiers {
+ ModPlain = 0x00,
+ ModShift = 0x01,
+ ModAltGr = 0x02,
+ ModControl = 0x04,
+ ModAlt = 0x08,
+ ModShiftL = 0x10,
+ ModShiftR = 0x20,
+ ModCtrlL = 0x40,
+ ModCtrlR = 0x80
+ // ModCapsShift = 0x100, // not supported!
+ };
+}
+
+inline QDataStream &operator>>(QDataStream &ds, QVxKeyboardMap::Mapping &m)
+{
+ return ds >> m.keycode >> m.unicode >> m.qtcode >> m.modifiers >> m.flags >> m.special;
+}
+
+inline QDataStream &operator<<(QDataStream &ds, const QVxKeyboardMap::Mapping &m)
+{
+ return ds << m.keycode << m.unicode << m.qtcode << m.modifiers << m.flags << m.special;
+}
+
+inline QDataStream &operator>>(QDataStream &ds, QVxKeyboardMap::Composing &c)
+{
+ return ds >> c.first >> c.second >> c.result;
+}
+
+inline QDataStream &operator<<(QDataStream &ds, const QVxKeyboardMap::Composing &c)
+{
+ return ds << c.first << c.second << c.result;
+}
+
+class QVxKeyboardHandler : public QObject
+{
+public:
+ QVxKeyboardHandler(const QString &device, QFdContainer &fd, bool disableZap, bool enableCompose, const QString &keymapFile);
+ ~QVxKeyboardHandler();
+
+ static std::unique_ptr<QVxKeyboardHandler> create(const QString &device,
+ const QString &specification,
+ const QString &defaultKeymapFile = QString());
+
+ static Qt::KeyboardModifiers toQtModifiers(quint8 mod)
+ {
+ Qt::KeyboardModifiers qtmod = Qt::NoModifier;
+
+ if (mod & (QVxKeyboardMap::ModShift | QVxKeyboardMap::ModShiftL | QVxKeyboardMap::ModShiftR))
+ qtmod |= Qt::ShiftModifier;
+ if (mod & (QVxKeyboardMap::ModControl | QVxKeyboardMap::ModCtrlL | QVxKeyboardMap::ModCtrlR))
+ qtmod |= Qt::ControlModifier;
+ if (mod & QVxKeyboardMap::ModAlt)
+ qtmod |= Qt::AltModifier;
+
+ return qtmod;
+ }
+
+ bool loadKeymap(const QString &file);
+ void unloadKeymap();
+
+ void readKeycode();
+ QKeycodeAction processKeycode(quint16 keycode, bool pressed, bool autorepeat);
+
+ void switchLang();
+
+private:
+ void processKeyEvent(int nativecode, int unicode, int qtcode,
+ Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat);
+
+ QString m_device;
+ QFdContainer m_fd;
+ QSocketNotifier *m_notify;
+
+ // keymap handling
+ quint8 m_modifiers;
+ quint8 m_locks[3];
+ int m_composing;
+ quint16 m_dead_unicode;
+ quint8 m_langLock;
+
+ bool m_no_zap;
+ bool m_do_compose;
+
+ const QKeyboardMap::Mapping *m_keymap;
+ int m_keymap_size;
+ const QKeyboardMap::Composing *m_keycompose;
+ int m_keycompose_size;
+
+ static const QKeyboardMap::Mapping s_keymap_default[];
+ static const QKeyboardMap::Composing s_keycompose_default[];
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QVXKEYBOARDHANDLER_P_H
diff --git a/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager.cpp b/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager.cpp
new file mode 100644
index 00000000000..7ed8d67fe1d
--- /dev/null
+++ b/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager.cpp
@@ -0,0 +1,114 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qvxkeyboardmanager_p.h"
+
+#include <QtInputSupport/private/qevdevutil_p.h>
+
+#include <QStringList>
+#include <QCoreApplication>
+#include <QLoggingCategory>
+
+#include <private/qguiapplication_p.h>
+#include <private/qinputdevicemanager_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace Qt::StringLiterals;
+
+QVxKeyboardManager::QVxKeyboardManager(const QString &key, const QString &specification, QObject *parent)
+ : QObject(parent)
+{
+ Q_UNUSED(key);
+
+
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_VXEVDEV_KEYBOARD_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ auto parsed = QEvdevUtil::parseSpecification(spec);
+ m_spec = std::move(parsed.spec);
+
+ // add all keyboards for devices specified in the argument list
+ for (const QString &device : std::as_const(parsed.devices))
+ addKeyboard(device);
+
+ if (parsed.devices.isEmpty()) {
+ qCDebug(qLcVxKey, "vxkeyboard: Using device discovery");
+ if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Keyboard, this)) {
+ // scan and add already connected keyboards
+ const QStringList devices = deviceDiscovery->scanConnectedDevices();
+ for (const QString &device : devices)
+ addKeyboard(device);
+
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ this, &QVxKeyboardManager::addKeyboard);
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ this, &QVxKeyboardManager::removeKeyboard);
+ }
+ }
+}
+
+QVxKeyboardManager::~QVxKeyboardManager()
+{
+}
+
+void QVxKeyboardManager::addKeyboard(const QString &deviceNode)
+{
+ qCDebug(qLcVxKey, "Adding keyboard at %ls", qUtf16Printable(deviceNode));
+ auto keyboard = QVxKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile);
+ if (keyboard) {
+ m_keyboards.add(deviceNode, std::move(keyboard));
+ updateDeviceCount();
+ } else {
+ qWarning("Failed to open keyboard device %ls", qUtf16Printable(deviceNode));
+ }
+}
+
+void QVxKeyboardManager::removeKeyboard(const QString &deviceNode)
+{
+ if (m_keyboards.remove(deviceNode)) {
+ qCDebug(qLcVxKey, "Removing keyboard at %ls", qUtf16Printable(deviceNode));
+ updateDeviceCount();
+ }
+}
+
+void QVxKeyboardManager::updateDeviceCount()
+{
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count());
+}
+
+void QVxKeyboardManager::loadKeymap(const QString &file)
+{
+ m_defaultKeymapFile = file;
+
+ if (file.isEmpty()) {
+ // Restore the default, which is either the built-in keymap or
+ // the one given in the plugin spec.
+ QString keymapFromSpec;
+ const auto specs = QStringView{m_spec}.split(u':');
+ for (const auto &arg : specs) {
+ if (arg.startsWith("keymap="_L1))
+ keymapFromSpec = arg.mid(7).toString();
+ }
+ for (const auto &keyboard : m_keyboards) {
+ if (keymapFromSpec.isEmpty())
+ keyboard.handler->unloadKeymap();
+ else
+ keyboard.handler->loadKeymap(keymapFromSpec);
+ }
+ } else {
+ for (const auto &keyboard : m_keyboards)
+ keyboard.handler->loadKeymap(file);
+ }
+}
+
+void QVxKeyboardManager::switchLang()
+{
+ for (const auto &keyboard : m_keyboards)
+ keyboard.handler->switchLang();
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager_p.h b/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager_p.h
new file mode 100644
index 00000000000..13d55b98383
--- /dev/null
+++ b/src/platformsupport/input/vxkeyboard/qvxkeyboardmanager_p.h
@@ -0,0 +1,51 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QVXKEYBOARDMANAGER_P_H
+#define QVXKEYBOARDMANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qvxkeyboardhandler_p.h"
+
+#include <QtInputSupport/private/devicehandlerlist_p.h>
+#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
+
+#include <QObject>
+#include <QHash>
+#include <QSocketNotifier>
+
+QT_BEGIN_NAMESPACE
+
+class QVxKeyboardManager : public QObject
+{
+public:
+ QVxKeyboardManager(const QString &key, const QString &specification, QObject *parent = nullptr);
+ ~QVxKeyboardManager();
+
+ void loadKeymap(const QString &file);
+ void switchLang();
+
+ void addKeyboard(const QString &deviceNode = QString());
+ void removeKeyboard(const QString &deviceNode);
+
+private:
+ void updateDeviceCount();
+
+ QString m_spec;
+ QtInputSupport::DeviceHandlerList<QVxKeyboardHandler> m_keyboards;
+ QString m_defaultKeymapFile;
+};
+
+QT_END_NAMESPACE
+
+#endif // QVXKEYBOARDMANAGER_P_H
diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt
index fd67f5d3fea..068978ec08e 100644
--- a/src/plugins/generic/CMakeLists.txt
+++ b/src/plugins/generic/CMakeLists.txt
@@ -10,6 +10,7 @@ if(QT_FEATURE_evdev AND QT_FEATURE_tabletevent)
add_subdirectory(evdevtablet)
endif()
if(QT_FEATURE_vxworksevdev)
+ add_subdirectory(vxkeyboard)
add_subdirectory(vxmouse)
endif()
if(QT_FEATURE_tslib)
diff --git a/src/plugins/generic/vxkeyboard/CMakeLists.txt b/src/plugins/generic/vxkeyboard/CMakeLists.txt
new file mode 100644
index 00000000000..953a26d5bfa
--- /dev/null
+++ b/src/plugins/generic/vxkeyboard/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+#####################################################################
+## QEvdevKeyboardPlugin Plugin:
+#####################################################################
+
+qt_internal_add_plugin(QVxKeyboardPlugin
+ OUTPUT_NAME qvxkeyboardplugin
+ PLUGIN_TYPE generic
+ DEFAULT_IF FALSE
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::CorePrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::InputSupportPrivate
+)
diff --git a/src/plugins/generic/vxkeyboard/main.cpp b/src/plugins/generic/vxkeyboard/main.cpp
new file mode 100644
index 00000000000..981b93bbaf5
--- /dev/null
+++ b/src/plugins/generic/vxkeyboard/main.cpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QtGui/qgenericplugin.h>
+#include <QtInputSupport/private/qvxkeyboardmanager_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVxKeyboardPlugin : public QGenericPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QGenericPluginFactoryInterface_iid FILE "vxkeyboard.json")
+
+public:
+ QVxKeyboardPlugin();
+
+ QObject* create(const QString &key, const QString &specification) override;
+};
+
+QVxKeyboardPlugin::QVxKeyboardPlugin()
+ : QGenericPlugin()
+{
+}
+
+QObject* QVxKeyboardPlugin::create(const QString &key,
+ const QString &specification)
+{
+ if (!key.compare(QLatin1String("VxKeyboard"), Qt::CaseInsensitive))
+ return new QVxKeyboardManager(key, specification);
+
+ return nullptr;
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/generic/vxkeyboard/vxkeyboard.json b/src/plugins/generic/vxkeyboard/vxkeyboard.json
new file mode 100644
index 00000000000..d1cc8ca401e
--- /dev/null
+++ b/src/plugins/generic/vxkeyboard/vxkeyboard.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "VxKeyboard" ]
+}
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index f60fe28b84d..878b702f6a7 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -48,9 +48,8 @@
#include <QtInputSupport/private/qevdevmousemanager_p.h>
#include <QtInputSupport/private/qevdevkeyboardmanager_p.h>
#include <QtInputSupport/private/qevdevtouchmanager_p.h>
-#endif
-
-#if QT_CONFIG(vxworksevdev)
+#elif QT_CONFIG(vxworksevdev)
+#include <QtInputSupport/private/qvxkeyboardmanager_p.h>
#include <QtInputSupport/private/qvxmousemanager_p.h>
#endif
@@ -74,8 +73,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
QEglFSIntegration::QEglFSIntegration()
- : m_kbdMgr(nullptr),
- m_display(EGL_NO_DISPLAY),
+ : m_display(EGL_NO_DISPLAY),
m_inputContext(nullptr),
m_fontDb(new QGenericUnixFontDatabase),
m_services(new QGenericUnixServices),
@@ -399,7 +397,7 @@ QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) cons
return QPlatformIntegration::styleHint(hint);
}
-#if QT_CONFIG(evdev)
+#if QT_CONFIG(evdev) || QT_CONFIG(vxworksevdev)
void QEglFSIntegration::loadKeymap(const QString &filename)
{
if (m_kbdMgr)
@@ -440,6 +438,7 @@ void QEglFSIntegration::createInputHandlers()
#endif
new QEvdevTouchManager("EvdevTouch"_L1, QString() /* spec */, this);
#elif QT_CONFIG(vxworksevdev)
+ m_kbdMgr = new QVxKeyboardManager("VxKeyboard"_L1, QString() /* spec */, this);
new QVxMouseManager("VxMouse"_L1, QString() /* spec */, this);
#endif
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
index 8007167ec74..f332db55e3d 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
@@ -30,11 +30,17 @@ QT_BEGIN_NAMESPACE
class QEglFSWindow;
class QEglFSContext;
class QFbVtHandler;
+#if QT_CONFIG(evdev)
class QEvdevKeyboardManager;
+#elif QT_CONFIG(vxworksevdev)
+class QVxKeyboardManager;
+#endif
class Q_EGLFS_EXPORT QEglFSIntegration : public QPlatformIntegration, public QPlatformNativeInterface
#if QT_CONFIG(evdev)
, public QNativeInterface::Private::QEvdevKeyMapper
+#elif QT_CONFIG(vxworksevdev)
+ , public QNativeInterface::Private::QVxKeyMapper
#endif
#ifndef QT_NO_OPENGL
, public QNativeInterface::Private::QEGLIntegration
@@ -83,14 +89,18 @@ public:
QPointer<QWindow> pointerWindow() { return m_pointerWindow; }
void setPointerWindow(QWindow *pointerWindow) { m_pointerWindow = pointerWindow; }
-#if QT_CONFIG(evdev)
+#if QT_CONFIG(evdev) || QT_CONFIG(vxworksevdev)
void loadKeymap(const QString &filename) override;
void switchLang() override;
#endif
protected:
virtual void createInputHandlers();
- QEvdevKeyboardManager *m_kbdMgr;
+#if QT_CONFIG(evdev)
+ QEvdevKeyboardManager *m_kbdMgr = nullptr;
+#elif QT_CONFIG(vxworksevdev)
+ QVxKeyboardManager *m_kbdMgr = nullptr;
+#endif
private:
EGLNativeDisplayType nativeDisplay() const;