diff options
Diffstat (limited to 'src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp')
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp index e21e1d7..bc92d0e 100644 --- a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp +++ b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp @@ -1,12 +1,57 @@ #include "qopenkodeeventloopintegration.h" +#include <QDebug> + #include <KD/kd.h> +#include <KD/ATX_keyboard.h> QT_BEGIN_NAMESPACE +static const int QT_EVENT_WAKEUP_EVENTLOOP = KD_EVENT_USER + 1; + +void kdprocessevent( const KDEvent *event) +{ + switch (event->type) { + case KD_EVENT_INPUT: + qDebug() << "KD_EVENT_INPUT"; + break; + case KD_EVENT_INPUT_POINTER: + qDebug() << "KD_EVENT_INPUT_POINTER"; + break; + case KD_EVENT_WINDOW_CLOSE: + qDebug() << "KD_EVENT_WINDOW_CLOSE"; + break; + case KD_EVENT_WINDOWPROPERTY_CHANGE: + qDebug() << "KD_EVENT_WINDOWPROPERTY_CHANGE"; + qDebug() << event->data.windowproperty.pname; + break; + case KD_EVENT_WINDOW_FOCUS: + qDebug() << "KD_EVENT_WINDOW_FOCUS"; + break; + case KD_EVENT_WINDOW_REDRAW: + qDebug() << "KD_EVENT_WINDOW_REDRAW"; + break; + case KD_EVENT_USER: + qDebug() << "KD_EVENT_USER"; + break; + case KD_EVENT_INPUT_KEY_ATX: + qDebug() << "KD_EVENT_INPUT_KEY_ATX"; + break; + case QT_EVENT_WAKEUP_EVENTLOOP: +// qDebug() << "QT_EVENT_WAKEUP_EVENTLOOP"; + break; + default: + break; + } + + kdDefaultEvent(event); + +} + QOpenKODEEventLoopIntegration::QOpenKODEEventLoopIntegration() { m_kdThread = kdThreadSelf(); + kdInstallCallback(&kdprocessevent,QT_EVENT_WAKEUP_EVENTLOOP,this); } void QOpenKODEEventLoopIntegration::processEvents(qint64 msec) @@ -25,6 +70,8 @@ void QOpenKODEEventLoopIntegration::processEvents(qint64 msec) void QOpenKODEEventLoopIntegration::wakeup() { KDEvent *event = kdCreateEvent(); + event->type = QT_EVENT_WAKEUP_EVENTLOOP; + event->userptr = this; kdPostThreadEvent(event,m_kdThread); } |