summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-12-11 09:57:48 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2009-12-11 09:57:48 +0100
commit0447b44246ff46eb273f95b6daf3e7f7de73ca6b (patch)
treeb1a6dff3d52d18d53eb4a2f56242176f08cb767f
parent2a0229375424499b9d83dd3214595efdc624a8a1 (diff)
Minimaldfb: wheelevent
-rw-r--r--src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp17
-rw-r--r--src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp
index b6f0b65f1f..744b5c0e5e 100644
--- a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp
+++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp
@@ -65,9 +65,11 @@ void QDirectFbInput::handleEvents()
case DWET_BUTTONDOWN:
case DWET_BUTTONUP:
case DWET_MOTION:
- case DWET_WHEEL:
handleMouseEvents(event);
break;
+ case DWET_WHEEL:
+ handleWheelEvent(event);
+ break;
case DWET_KEYDOWN:
case DWET_KEYUP:
handleKeyEvents(event);
@@ -117,6 +119,19 @@ void QDirectFbInput::handleMouseEvents(const DFBEvent &event)
QApplicationPrivate::handleMouseEvent(tlw,mouseEvent);
}
+void QDirectFbInput::handleWheelEvent(const DFBEvent &event)
+{
+ QPoint p(event.window.cx, event.window.cy);
+ QPoint globalPos = globalPoint(event);
+ Qt::MouseButton button = QDirectFbConvenience::mouseButton(event.window.button);
+ Qt::MouseButtons buttons = QDirectFbConvenience::mouseButtons(event.window.buttons);
+ QWidget *tlw = tlwMap.value(event.window.window_id);
+
+ QWheelEvent wheelEvent(p,globalPos,event.window.step*120,buttons,Qt::NoModifier,Qt::Vertical);
+ QApplicationPrivate::handleWheelEvent(tlw,wheelEvent);
+
+}
+
void QDirectFbInput::handleKeyEvents(const DFBEvent &event)
{
QEvent::Type type = QDirectFbConvenience::eventType(event.window.type);
diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h
index ddc2dbf85e..3a703298bf 100644
--- a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h
+++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.h
@@ -36,6 +36,7 @@ public slots:
private:
void handleMouseEvents(const DFBEvent &event);
+ void handleWheelEvent(const DFBEvent &event);
void handleKeyEvents(const DFBEvent &event);
IDirectFB *dfbInterface;
IDirectFBDisplayLayer *dfbDisplayLayer;