diff options
Diffstat (limited to 'src/gui/kernel/qkeymapper.cpp')
-rw-r--r-- | src/gui/kernel/qkeymapper.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp index 0e150a9c1e..2ec72fd2d0 100644 --- a/src/gui/kernel/qkeymapper.cpp +++ b/src/gui/kernel/qkeymapper.cpp @@ -45,6 +45,9 @@ #include <private/qobject_p.h> #include "qkeymapper_p.h" +#include <private/qguiapplication_p.h> +#include <qpa/qplatformintegration.h> + QT_BEGIN_NAMESPACE /*! @@ -117,4 +120,32 @@ QKeyMapperPrivate *qt_keymapper_private() return QKeyMapper::instance()->d_func(); } +QKeyMapperPrivate::QKeyMapperPrivate() +{ + keyboardInputLocale = QLocale::system(); + keyboardInputDirection = keyboardInputLocale.textDirection(); +} + +QKeyMapperPrivate::~QKeyMapperPrivate() +{ + // clearMappings(); +} + +void QKeyMapperPrivate::clearMappings() +{ +} + +QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e) +{ + QList<int> result = QGuiApplicationPrivate::platformIntegration()->possibleKeys(e); + if (!result.isEmpty()) + return result; + + if (e->key() && (e->key() != Qt::Key_unknown)) + result << int(e->key() + e->modifiers()); + else if (!e->text().isEmpty()) + result << int(e->text().at(0).unicode() + e->modifiers()); + return result; +} + QT_END_NAMESPACE |