9#include <qpa/qwindowsysteminterface.h>
19 , m_dfbDisplayLayer(dfbLayer)
22 DFBResult
ok = m_dfbInterface->CreateEventBuffer(m_dfbInterface, m_eventBuffer.
outPtr());
24 DirectFBError(
"Failed to initialise eventbuffer",
ok);
29 while (!m_shouldStop) {
30 if (m_eventBuffer->WaitForEvent(m_eventBuffer.
data()) == DFB_OK)
38 m_eventBuffer->WakeUp(m_eventBuffer.
data());
48 DirectFBError(
"QDirectFbInput::addWindow",
res);
52 m_tlwMap.
insert(
id, platformWindow);
63 DirectFBError(
"QDirectFbInput::removeWindow",
res);
71void QDirectFbInput::handleEvents()
73 DFBResult hasEvent = m_eventBuffer->HasEvent(m_eventBuffer.
data());
74 while(hasEvent == DFB_OK){
76 DFBResult
ok = m_eventBuffer->GetEvent(m_eventBuffer.
data(), &
event);
78 DirectFBError(
"Failed to get event",
ok);
79 if (
event.clazz == DFEC_WINDOW) {
80 switch (
event.window.type) {
84 handleMouseEvents(
event);
87 handleWheelEvent(
event);
91 handleKeyEvents(
event);
95 handleEnterLeaveEvents(
event);
98 handleGotFocusEvent(
event);
101 handleCloseEvent(
event);
103 case DWET_POSITION_SIZE:
104 handleGeometryEvent(
event);
112 hasEvent = m_eventBuffer->HasEvent(m_eventBuffer.
data());
116void QDirectFbInput::handleMouseEvents(
const DFBEvent &
event)
126 long timestamp = (
event.window.timestamp.tv_sec*1000) + (
event.window.timestamp.tv_usec/1000);
132void QDirectFbInput::handleWheelEvent(
const DFBEvent &
event)
136 long timestamp = (
event.window.timestamp.tv_sec*1000) + (
event.window.timestamp.tv_usec/1000);
146void QDirectFbInput::handleKeyEvents(
const DFBEvent &
event)
152 long timestamp = (
event.window.timestamp.tv_sec*1000) + (
event.window.timestamp.tv_usec/1000);
155 if (DFB_KEY_TYPE(
event.window.key_symbol) == DIKT_UNICODE)
161void QDirectFbInput::handleEnterLeaveEvents(
const DFBEvent &
event)
164 switch (
event.window.type) {
176void QDirectFbInput::handleGotFocusEvent(
const DFBEvent &
event)
182void QDirectFbInput::handleCloseEvent(
const DFBEvent &
event)
188void QDirectFbInput::handleGeometryEvent(
const DFBEvent &
event)
static QEvent::Type eventType(DFBWindowEventType type)
static Qt::MouseButtons mouseButtons(DFBInputDeviceButtonMask mask)
static Qt::KeyboardModifiers keyboardModifiers(DFBInputDeviceModifierMask mask)
static QDirectFbKeyMap * keyMap()
static IDirectFBDisplayLayer * dfbDisplayLayer(int display=DLID_PRIMARY)
Type
This enum type defines the valid event types in Qt.
bool remove(const Key &key)
Removes the item that has the key from the hash.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
T * data() const noexcept
Returns the value of the pointer referenced by this object.
static void handleLeaveEvent(QWindow *window)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static bool handleCloseEvent(QWindow *window)
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static bool handleKeyEvent(QWindow *window, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
static void handleWindowActivated(QWindow *window, Qt::FocusReason r=Qt::OtherFocusReason)
static void handleEnterEvent(QWindow *window, const QPointF &local=QPointF(), const QPointF &global=QPointF())
static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
@ ActiveWindowFocusReason