diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2009-12-10 12:37:36 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2009-12-10 12:37:36 (GMT) |
commit | a4c7e91befad73601c0ee6e194a5dfeb6cac61a9 (patch) | |
tree | 3d2a26be4b3d59f63cd8344c76f6071f40f7bcda /src/plugins | |
parent | 594427bcd0351350c2d2298d6b193bb1014b6bda (diff) | |
download | Qt-a4c7e91befad73601c0ee6e194a5dfeb6cac61a9.zip Qt-a4c7e91befad73601c0ee6e194a5dfeb6cac61a9.tar.gz Qt-a4c7e91befad73601c0ee6e194a5dfeb6cac61a9.tar.bz2 |
Added keypresses to minimaldfbinput
Diffstat (limited to 'src/plugins')
4 files changed, 23 insertions, 2 deletions
diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbconvenience.cpp b/src/plugins/graphicssystems/minimaldfb/qdirectfbconvenience.cpp index f0293bd..cd1f568 100644 --- a/src/plugins/graphicssystems/minimaldfb/qdirectfbconvenience.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbconvenience.cpp @@ -83,6 +83,10 @@ QEvent::Type QDirectFbConvenience::eventType(DFBWindowEventType type) return QEvent::MouseMove; case DWET_WHEEL: return QEvent::Wheel; + case DWET_KEYDOWN: + return QEvent::KeyPress; + case DWET_KEYUP: + return QEvent::KeyRelease; default: return QEvent::None; } diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp index 695c985..7c8d3c2 100644 --- a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp @@ -68,6 +68,9 @@ void QDirectFbInput::handleEvents() case DWET_WHEEL: handleMouseEvents(event); break; + case DWET_KEYDOWN: + case DWET_KEYUP: + handleKeyEvents(event); } } else @@ -85,12 +88,21 @@ void QDirectFbInput::handleMouseEvents(const DFBEvent &event) Qt::MouseButton button = QDirectFbConvenience::mouseButton(event.window.button); Qt::MouseButtons buttons = QDirectFbConvenience::mouseButtons(event.window.buttons); - qDebug() << QDirectFbConvenience::keyMap()->value(event.window.key_symbol); QMouseEvent mouseEvent(type,p,globalPos,button, buttons,(Qt::KeyboardModifiers)0); QWidget *tlw = tlwMap.value(event.window.window_id); QApplicationPrivate::handleMouseEvent(tlw,mouseEvent); } +void QDirectFbInput::handleKeyEvents(const DFBEvent &event) +{ + QEvent::Type type = QDirectFbConvenience::eventType(event.window.type); + Qt::Key key = QDirectFbConvenience::keyMap()->value(event.window.key_symbol); + + QKeyEvent keyEvent(type,key,0,QChar(event.window.key_symbol));//,"",true,0); + QWidget *tlw = tlwMap.value(event.window.window_id); + QApplicationPrivate::handleKeyEvent(tlw,&keyEvent); +} + inline QPoint QDirectFbInput::globalPoint(const DFBEvent &event) const { IDirectFBWindow *window; diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h index 529d51a..ddc2dbf 100644 --- a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h +++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h @@ -35,7 +35,8 @@ public slots: private: - void handleMouseEvents(const DFBEvent & event); + void handleMouseEvents(const DFBEvent &event); + void handleKeyEvents(const DFBEvent &event); IDirectFB *dfbInterface; IDirectFBDisplayLayer *dfbDisplayLayer; IDirectFBEventBuffer *eventBuffer; diff --git a/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp b/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp index 0583364..fe3b1d8 100644 --- a/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp @@ -62,6 +62,10 @@ QDirectFbGraphicsSystemScreen::QDirectFbGraphicsSystemScreen(IDirectFB *dfb, int DirectFBError("QDirectFbGraphicsSystemScreen " "Unable to get primary display layer!", result); } + DFBDisplayLayerConfig *displayLayerConfig; +// m_layer->GetConfiguration(m_layer,displayLayerConfig); +// displayLayerConfig->surface_caps = DFBSurfaceCapabilities(displayLayerConfig->surface_caps | DSCAPS_PREMULTIPLIED); +// m_layer->SetConfiguration(m_layer, displayLayerConfig); m_layer->SetCooperativeLevel(m_layer,DLSCL_SHARED); IDirectFBSurface *topLevelSurface; |