diff options
author | Paul Lemire <paul.lemire.ecortex@kdab.com> | 2014-11-12 09:53:13 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-11-14 20:29:19 +0100 |
commit | 6e89619c511e9d1d622bd0e98f7dcc771624022b (patch) | |
tree | 41cd8e5367e224299e1ef85b139a5e664085fe39 /src/input/keyboardeventfilter.cpp | |
parent | b50e545211a35f676387c185376cc7a54cb9587e (diff) |
InputHandler/KeyboardEventFilter: QKeyEvents are stored
This will allow AspectJob to process those events for the next frame. Uses a
QMutex to protect concurrent accesses.
Change-Id: Iae925bbf9e27d4c1712b72ff74c2ca3e2974ecaa
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/keyboardeventfilter.cpp')
-rw-r--r-- | src/input/keyboardeventfilter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/input/keyboardeventfilter.cpp b/src/input/keyboardeventfilter.cpp index ee042a7b6..f81fd05f6 100644 --- a/src/input/keyboardeventfilter.cpp +++ b/src/input/keyboardeventfilter.cpp @@ -65,10 +65,9 @@ void KeyboardEventFilter::setInputHandler(InputHandler *handler) // Triggered in QWindow thread (usually the main thread) bool KeyboardEventFilter::eventFilter(QObject *obj, QEvent *e) { - if (e->type() == QEvent::KeyPress) { - // Store event to be processed later on in an InputAspect job - } else if (e->type() == QEvent::KeyRelease) { + if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) { // Store event to be processed later on in an InputAspect job + m_inputHandler->appendKeyEvent(QKeyEvent(*static_cast<QKeyEvent *>(e))); } return QObject::eventFilter(obj, e); } |