diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-07 16:38:59 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-07 16:38:59 (GMT) |
commit | 2bc7d2af6be2b09c38e989f339ec2ee33cc204eb (patch) | |
tree | b66d5f7bc735003c4667f2cd9c45431ff8fbc4b7 /src/plugins/platforms | |
parent | 30080bdcb226a5a815465299bcb0dbb6a347cb1c (diff) | |
download | Qt-2bc7d2af6be2b09c38e989f339ec2ee33cc204eb.zip Qt-2bc7d2af6be2b09c38e989f339ec2ee33cc204eb.tar.gz Qt-2bc7d2af6be2b09c38e989f339ec2ee33cc204eb.tar.bz2 |
Lighthouse: Fix keyboard on testlite
Remove code which was wrong
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/testlite/qtestlitekeyboard.cpp | 24 | ||||
-rw-r--r-- | src/plugins/platforms/testlite/qtestlitekeyboard.h | 1 |
2 files changed, 7 insertions, 18 deletions
diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp index ca4c203..72e6d50 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.cpp +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.cpp @@ -1,7 +1,5 @@ #include "qtestlitekeyboard.h" -#include <QDebug> - #include "qtestlitescreen.h" #include <QtGui/QWindowSystemInterface> @@ -949,21 +947,13 @@ static Qt::KeyboardModifiers modifierFromKeyCode(int qtcode) void QTestLiteKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, XKeyEvent *ev) { - const int xkeycode = ev->keycode; - const uint xmodifiers = ev->state; - - KeySym baseKeySym; - uint consumedModifiers; - if (!XkbLookupKeySym(m_screen->display(), xkeycode, (xmodifiers & (LockMask | m_num_lock_mask)), - &consumedModifiers, &baseKeySym)) - return; - - Qt::KeyboardModifiers baseModifiers = 0; - int baseCode = -1; + int qtcode = 0; + Qt::KeyboardModifiers modifiers = translateModifiers(ev->state); QByteArray chars; + chars.resize(513); int count = 0; - QString text = translateKeySym(baseKeySym, xmodifiers, baseCode, baseModifiers, chars, count); - - QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,baseCode,baseModifiers,text.left(count)); - + KeySym keySym; + count = XLookupString(ev,chars.data(),chars.size(),&keySym,0); + QString text = translateKeySym(keySym,ev->state,qtcode,modifiers,chars,count); + QWindowSystemInterface::handleKeyEvent(widget,ev->time,type,qtcode,modifiers,text.left(count)); } diff --git a/src/plugins/platforms/testlite/qtestlitekeyboard.h b/src/plugins/platforms/testlite/qtestlitekeyboard.h index 4e9d98d..65ead16 100644 --- a/src/plugins/platforms/testlite/qtestlitekeyboard.h +++ b/src/plugins/platforms/testlite/qtestlitekeyboard.h @@ -14,7 +14,6 @@ public: Qt::KeyboardModifiers translateModifiers(int s); - enum { MaxBits = sizeof(uint) * 8 }; private: void setMask(KeySym sym, uint mask); |