Handle KeyRelease events of global shortcuts.

This commit is contained in:
Felix Geyer 2012-11-20 23:41:28 +01:00
parent 54641a2304
commit 8b0409b228

View File

@ -154,10 +154,14 @@ int AutoTypePlatformX11::platformEventFilter(void* event)
{ {
XEvent* xevent = static_cast<XEvent*>(event); XEvent* xevent = static_cast<XEvent*>(event);
if (xevent->type == KeyPress && m_currentGlobalKey && xevent->xkey.keycode == m_currentGlobalKeycode if ((xevent->type == KeyPress || xevent->type == KeyRelease)
&& m_currentGlobalKey
&& xevent->xkey.keycode == m_currentGlobalKeycode
&& (xevent->xkey.state & m_modifierMask) == m_currentGlobalNativeModifiers && (xevent->xkey.state & m_modifierMask) == m_currentGlobalNativeModifiers
&& !QApplication::focusWidget()) { && !QApplication::focusWidget()) {
Q_EMIT globalShortcutTriggered(); if (xevent->type == KeyPress) {
Q_EMIT globalShortcutTriggered();
}
return 1; return 1;
} }
if (xevent->type == MappingNotify) { if (xevent->type == MappingNotify) {