summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-07-25 14:36:16 +0300
committerQt by Nokia <qt-info@nokia.com>2012-07-28 15:23:07 +0200
commit05c07c7636012ebb4131ca099ca4ea093af76410 (patch)
tree4ea415df73c850c8fa7ea524e5a629cfe35b3bae /src/platformsupport/input
parent10cd17d0d3f373842e9fc9f1045a320f6140a963 (diff)
Send the native scancode in evdevkeyboard
Until now the native scancode was not specified which meant when qwindow-compositor (or any other Qt-based compositor using the standard Wayland protocol, i.e. sendKeyPress() and such) tried to send the native scancode over to the clients, all it got was a code of 0. This fixes keyboard input when running qwindow-compositor on top of kms and EvdevKeyboard. Change-Id: I5d9a882f249634fb7584900b5f298f794befee3b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/platformsupport/input')
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp9
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h3
2 files changed, 8 insertions, 4 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index f3dd713254..54a4f0c1b6 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -215,9 +215,12 @@ void QEvdevKeyboardHandler::readKeycode()
}
}
-void QEvdevKeyboardHandler::processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
+void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtcode,
+ Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
{
- QWindowSystemInterface::handleKeyEvent(0, ( isPress ? QEvent::KeyPress : QEvent::KeyRelease ), keycode, modifiers, QString( unicode ), autoRepeat );
+ QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease),
+ qtcode, modifiers, nativecode + 8, 0, int(modifiers),
+ QString(unicode), autoRepeat);
}
QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint16 keycode, bool pressed, bool autorepeat)
@@ -396,7 +399,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
#endif
// send the result to the server
- processKeyEvent(unicode, qtcode & ~modmask, Qt::KeyboardModifiers(qtcode & modmask), pressed, autorepeat);
+ processKeyEvent(keycode, unicode, qtcode & ~modmask, Qt::KeyboardModifiers(qtcode & modmask), pressed, autorepeat);
}
}
return result;
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
index 2d38df814d..92370a9163 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
@@ -170,7 +170,8 @@ private slots:
private:
void unloadKeymap();
bool loadKeymap(const QString &file);
- void processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat);
+ void processKeyEvent(int nativecode, int unicode, int qtcode,
+ Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat);
void switchLed(int, bool);
QString m_device;