Propagate keyboard event accept status
Set the accepted bit on the QWindowsystemInterface keyboard event after processing the key event. Change-Id: I2d8c9382f14840e464153870dff909000e64ddcd Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This commit is contained in:
parent
e5d54c8af7
commit
65cbf263a3
@ -1935,6 +1935,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
e->eventAccepted = ev.isAccepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
|
void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
|
||||||
|
@ -303,24 +303,24 @@ bool QWindowSystemInterface::tryHandleExtendedShortcutEvent(QWindow *w, ulong ti
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
|
bool QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) {
|
||||||
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
|
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
|
||||||
handleKeyEvent(w, time, t, k, mods, text, autorep, count);
|
return handleKeyEvent(w, time, t, k, mods, text, autorep, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
|
bool QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
|
||||||
{
|
{
|
||||||
// This is special handling needed for OS X which eventually will call sendEvent(), on other platforms
|
// This is special handling needed for OS X which eventually will call sendEvent(), on other platforms
|
||||||
// this might not be safe, e.g., on Android. See: QGuiApplicationPrivate::processKeyEvent() for
|
// this might not be safe, e.g., on Android. See: QGuiApplicationPrivate::processKeyEvent() for
|
||||||
// shortcut overriding on other platforms.
|
// shortcut overriding on other platforms.
|
||||||
#if defined(Q_OS_OSX)
|
#if defined(Q_OS_OSX)
|
||||||
if (t == QEvent::KeyPress && QWindowSystemInterface::tryHandleShortcutEvent(tlw, timestamp, k, mods, text))
|
if (t == QEvent::KeyPress && QWindowSystemInterface::tryHandleShortcutEvent(tlw, timestamp, k, mods, text))
|
||||||
return;
|
return true;
|
||||||
#endif // Q_OS_OSX
|
#endif // Q_OS_OSX
|
||||||
|
|
||||||
QWindowSystemInterfacePrivate::KeyEvent * e =
|
QWindowSystemInterfacePrivate::KeyEvent * e =
|
||||||
new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, t, k, mods, text, autorep, count);
|
new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, t, k, mods, text, autorep, count);
|
||||||
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
|
return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWindowSystemInterface::handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
|
void QWindowSystemInterface::handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
|
||||||
|
@ -95,8 +95,8 @@ public:
|
|||||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||||
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||||
|
|
||||||
static void handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
static bool handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||||
static void handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
static bool handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1);
|
||||||
|
|
||||||
static void handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
|
static void handleExtendedKeyEvent(QWindow *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers,
|
||||||
quint32 nativeScanCode, quint32 nativeVirtualKey,
|
quint32 nativeScanCode, quint32 nativeVirtualKey,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user