[Development] Qt Keyboard Shortcuts broken in Qt 5.6 (since 4.8 at least). Reproducible test case included.
Thiago Macieira
thiago.macieira at intel.com
Sun Apr 10 09:23:53 CEST 2016
On domingo, 10 de abril de 2016 00:14:01 PDT Thiago Macieira wrote:
> > press:
> > Meta-Ctrl-Alt-L
> > OUTPUT: (none); window flashes
>
> That has nothing to do with shortcuts. It appears that the way that
> khotkeysd sends keypresses isn't working in Creator. It's irrelevant what
> Creator does: the bug is in khotkeysd because it isn't sending the input in
> such a way that some applications can't ignore.
According to qev, Qt 5 is seeing these events:
QKeyEvent(ShortcutOverride, Key_Control, ControlModifier)
QKeyEvent(KeyPress, Key_Control, ControlModifier)
QKeyEvent(ShortcutOverride, Key_Meta, ControlModifier|MetaModifier)
QKeyEvent(KeyPress, Key_Meta, ControlModifier|MetaModifier)
QKeyEvent(ShortcutOverride, Key_Alt, ControlModifier|AltModifier|MetaModifier)
QKeyEvent(KeyPress, Key_Alt, ControlModifier|AltModifier|MetaModifier)
QEvent(WindowDeactivate, 0x7ffe906ee2a0)
QEvent(ActivationChange, 0x7ffe906ee2e0)
QEvent(WindowActivate, 0x7ffe906ee2c0)
QEvent(ActivationChange, 0x7ffe906ee2e0)
QInputMethodQueryEvent(queries=0x101, {})
QKeyEvent(ShortcutOverride, Key_3, ShiftModifier, text="\u001B")
QKeyEvent(KeyPress, Key_3, ShiftModifier, text="\u001B")
QKeyEvent(KeyRelease, Key_3, ShiftModifier, text="\u001B")
QKeyEvent(ShortcutOverride, Key_X, text="\u0018")
QKeyEvent(KeyPress, Key_X, text="\u0018")
QKeyEvent(KeyRelease, Key_X, text="\u0018")
QKeyEvent(KeyRelease, Key_L, ControlModifier|AltModifier|MetaModifier, text="\f")
QKeyEvent(KeyRelease, Key_Alt, ControlModifier|MetaModifier)
QKeyEvent(KeyRelease, Key_Meta, ControlModifier)
QKeyEvent(KeyRelease, Key_Control)
As you can see, Qt did receive "Shift+3" and "X", but the text lookup returned
the result for Ctrl+3 and Ctrl+X.
As I said, the failure is in khotkeys: it needs to send the events in such a
way that the application can't tell the difference. Obviously, Qt 5 did.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list