diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-24 12:35:27 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-24 13:06:45 (GMT) |
commit | 99e32b0a2049f3b28d3a54bec31f2471586d8d74 (patch) | |
tree | 300c705d635b92abb6cca18247e6c215ab62b9b7 /src/gui/kernel/qwindowsysteminterface_qpa.cpp | |
parent | 5cda0ff17d82197de987b1c09959549995737b9c (diff) | |
download | Qt-99e32b0a2049f3b28d3a54bec31f2471586d8d74.zip Qt-99e32b0a2049f3b28d3a54bec31f2471586d8d74.tar.gz Qt-99e32b0a2049f3b28d3a54bec31f2471586d8d74.tar.bz2 |
Added extended key event support in QWindowSystemInterface.
These are needed for compositor applications to be able to send the
raw scan codes to the clients.
Reviewed-by: Jørgen Lind
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface_qpa.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index b6177b0..1fd4afd 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -150,6 +150,36 @@ void QWindowSystemInterface::handleKeyEvent(QWidget *tlw, ulong timestamp, QEven QWindowSystemInterfacePrivate::queueWindowSystemEvent(e); } +void QWindowSystemInterface::handleExtendedKeyEvent(QWidget *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, + quint32 nativeScanCode, quint32 nativeVirtualKey, + quint32 nativeModifiers, + const QString& text, bool autorep, + ushort count) +{ + unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed(); + handleExtendedKeyEvent(w, time, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, + text, autorep, count); +} + +void QWindowSystemInterface::handleExtendedKeyEvent(QWidget *tlw, ulong timestamp, QEvent::Type type, int key, + Qt::KeyboardModifiers modifiers, + quint32 nativeScanCode, quint32 nativeVirtualKey, + quint32 nativeModifiers, + const QString& text, bool autorep, + ushort count) +{ + if (tlw) { + QWidgetData *data = qt_qwidget_data(tlw); + if (data->in_destructor) + tlw = 0; + } + + QWindowSystemInterfacePrivate::KeyEvent * e = + new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, type, key, modifiers, + nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count); + QWindowSystemInterfacePrivate::queueWindowSystemEvent(e); +} + void QWindowSystemInterface::handleWheelEvent(QWidget *w, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) { unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed(); handleWheelEvent(w, time, local, global, d, o); |