diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-11 16:34:42 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-11 16:34:42 +0100 |
commit | 2ba9d7b561ced6db6a270e5ed0fb53a20299dc64 (patch) | |
tree | 8fe625c5d7e3c50774ee8b6f4d957ef3195fa26a | |
parent | 73bd4b93e0d46fdf6a32eb88ce8c7441ff8063da (diff) |
Hacky keyboard modifiers and text for key events
Requires the hacky addition to the window system as well, but note
that since the protocol is unchanged, you can still run any combination
of new/old server/client without anything blowing up. You just won't
get key events that work.
-rw-r--r-- | qgraphicssystem_dd.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qgraphicssystem_dd.cpp b/qgraphicssystem_dd.cpp index 56fbe22..7f680c3 100644 --- a/qgraphicssystem_dd.cpp +++ b/qgraphicssystem_dd.cpp @@ -284,10 +284,15 @@ void QDevDaysGraphicsSystem::eventDispatcher() QWindowSystemInterface::handleMouseEvent(window, pos, pos + window->pos(), b); break; } case Event::KeyPressEvent: { - QWindowSystemInterface::handleKeyEvent(window, QEvent::KeyPress, m_message.value, Qt::NoModifier); + QString s; + if ( m_message.rect.x()) + s = QChar(int(m_message.rect.x())); + Qt::KeyboardModifiers mods = static_cast<Qt::KeyboardModifiers>(m_message.rect.y()); + QWindowSystemInterface::handleKeyEvent(window, QEvent::KeyPress, m_message.value, mods, s); break; } case Event::KeyReleaseEvent: { - QWindowSystemInterface::handleKeyEvent(window, QEvent::KeyRelease, m_message.value, Qt::NoModifier); + Qt::KeyboardModifiers mods = static_cast<Qt::KeyboardModifiers>(m_message.rect.y()); + QWindowSystemInterface::handleKeyEvent(window, QEvent::KeyRelease, m_message.value, mods); break; } } break; } |