summaryrefslogtreecommitdiffstats
path: root/src/plugins/graphicssystems/testlite
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2009-11-02 12:07:18 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-11-02 12:08:16 (GMT)
commita69dce80169686ae156ec5e1898ab33676f3eb40 (patch)
tree07b2ad27e843392547569d7069c1ecfc271a019b /src/plugins/graphicssystems/testlite
parent60cde70b56aa183dce19cc913cd87e1d27f50090 (diff)
downloadQt-a69dce80169686ae156ec5e1898ab33676f3eb40.zip
Qt-a69dce80169686ae156ec5e1898ab33676f3eb40.tar.gz
Qt-a69dce80169686ae156ec5e1898ab33676f3eb40.tar.bz2
Use correct keycode for Ctrl+<letter>
Diffstat (limited to 'src/plugins/graphicssystems/testlite')
-rw-r--r--src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
index b14efb8..9e24f55 100644
--- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
+++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
@@ -521,20 +521,22 @@ void QTestLiteWindowSurface::handleKeyEvent(QEvent::Type type, void *ev)
int count = XLookupString(e, chars.data(), chars.size(), &keySym, 0);
-// qDebug() << "QTLWS::handleKeyEvent" << count << hex << "XKeysym:" << keySym;
-// if (count)
-// qDebug() << hex << int(chars[0]) << "String:" << chars;
+// qDebug() << "QTLWS::handleKeyEvent" << count << hex << "XKeysym:" << keySym;
+// if (count)
+// qDebug() << hex << int(chars[0]) << "String:" << chars;
Qt::KeyboardModifiers modifiers = translateModifiers(e->state);
int qtcode = lookupCode(keySym);
-// qDebug() << "lookup: " << hex << keySym << qtcode;
+// qDebug() << "lookup: " << hex << keySym << qtcode << "mod" << modifiers;
if (qtcode) {
QKeyEvent keyEvent(type, qtcode, modifiers);
QApplicationPrivate::handleKeyEvent(window(), &keyEvent);
} else if (chars[0]) {
int qtcode = chars.toUpper()[0]; //Not exactly right...
+ if (modifiers & Qt::ControlModifier && qtcode < ' ')
+ qtcode = chars[0] + '@';
QKeyEvent keyEvent(type, qtcode, modifiers, QString::fromLatin1(chars));
QApplicationPrivate::handleKeyEvent(window(), &keyEvent);
} else {