[Development] Qt/XCB applications and deadkeys (which cease working) (and sometimes the entire keyboard in Konsole)

René J. V. Bertin rjvbertin at gmail.com
Fri Jun 9 15:02:08 CEST 2017


Thiago Macieira wrote:

> Here's my output for <dead_acute> <e>:
> 
> KeyPress event, serial 40, synthetic NO, window 0x800001,
>     root 0xdb, subw 0x0, time 444468201, (-1603,615), root:(217,676),
>     state 0x0, keycode 48 (keysym 0xfe51, dead_acute), same_screen YES,
>     XLookupString gives 2 bytes: (c2 b4) "´"
>     XmbLookupString gives 0 bytes:
>     XFilterEvent returns: True
> 
> KeyRelease event, serial 40, synthetic NO, window 0x800001,
>     root 0xdb, subw 0x0, time 444468270, (-1603,615), root:(217,676),
>     state 0x0, keycode 48 (keysym 0xfe51, dead_acute), same_screen YES,
>     XLookupString gives 2 bytes: (c2 b4) "´"
>     XFilterEvent returns: False
> 
> KeyPress event, serial 40, synthetic NO, window 0x800001,
>     root 0xdb, subw 0x0, time 444470041, (-1603,615), root:(217,676),
>     state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
>     XLookupString gives 1 bytes: (65) "e"
>     XmbLookupString gives 1 bytes: (65) "e"
>     XFilterEvent returns: True
> 
> KeyPress event, serial 40, synthetic NO, window 0x800001,
>     root 0xdb, subw 0x0, time 444470041, (-1603,615), root:(217,676),
>     state 0x0, keycode 0 (keysym 0xe9, eacute), same_screen YES,
>     XLookupString gives 0 bytes:
>     XmbLookupString gives 2 bytes: (c3 a9) "é"
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 40, synthetic NO, window 0x800001,
>     root 0xdb, subw 0x0, time 444470098, (-1603,615), root:(217,676),
>     state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
>     XLookupString gives 1 bytes: (65) "e"
>     XFilterEvent returns: False
> 
> (note how there's an extra KeyPress I had never noticed before)

For future reference, here's what I see under normal conditions when I press 
AltGr+e e

KeyPress event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120475392, (99,141), root:(101,193),
    state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120475718, (99,141), root:(101,193),
    state 0x80, keycode 26 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 2 bytes: (c2 b4) "´"
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: True

KeyRelease event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120475844, (99,141), root:(101,193),
    state 0x80, keycode 26 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 2 bytes: (c2 b4) "´"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120476114, (99,141), root:(101,193),
    state 0x80, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120476349, (99,141), root:(101,193),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XmbLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: True

KeyPress event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120476349, (99,141), root:(101,193),
    state 0x0, keycode 0 (keysym 0xe9, eacute), same_screen YES,
    XKeysymToKeycode returns keycode: 11
    XLookupString gives 0 bytes: 
    XmbLookupString gives 2 bytes: (c3 a9) "é"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x7a00001,
    root 0xf6, subw 0x0, time 120476443, (99,141), root:(101,193),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: False

The dead_acute is there twice; I see it appearing only once when I manage to 
press the AltGr and e keys sufficiently simultaneously.

With qev/Qt 5.8 I see this:

qt.qpa.input.methods: filterEventFinished return 108 65027 0 false
QKeyEvent(ShortcutOverride, Key_AltGr, GroupSwitchModifier) 
QKeyEvent(KeyPress, Key_AltGr, GroupSwitchModifier) 
qt.qpa.input.methods: filterEventFinished return 26 65105 128 true
qt.qpa.input.methods: filterEventFinished return 26 65105 128 false
QKeyEvent(KeyRelease, Key_Dead_Acute, GroupSwitchModifier) 
qt.qpa.input.methods: filterEventFinished return 108 65027 128 false
QKeyEvent(KeyRelease, Key_AltGr) 
qt.qpa.input.methods.serialize: QIBusText::fromDBusArgument() "(sa{sv}sv)"
qt.qpa.input.methods.serialize: QIBusAttributeList::fromDBusArgument() 
"(sa{sv}av)"
QInputMethodEvent(, commit="U+e9") 
qt.qpa.input.methods: filterEventFinished return 26 101 0 true
qt.qpa.input.methods: filterEventFinished return 26 101 0 false
QKeyEvent(KeyRelease, Key_E, text="e") 

And with qev/4.8.7 (is there any way to get the equivalent of qInfo there?):
QKeyEvent(ShortcutOverride, key=0x1001103)
QKeyEvent(KeyPress, key=0x1001103)
QKeyEvent(ShortcutOverride, key=0x1001251, modifiers=0x40000000, text="´")
QKeyEvent(KeyPress, key=0x1001251, modifiers=0x40000000, text="´")
QKeyEvent(KeyRelease, key=0x1001251, modifiers=0x40000000, text="´")
QKeyEvent(KeyRelease, key=0x1001103, modifiers=0x40000000)
QKeyEvent(ShortcutOverride, key=0x45, text="e")
QKeyEvent(KeyPress, key=0x45, text="e")
QKeyEvent(KeyRelease, key=0x45, text="e")

(that's the qev source from 5.8.0 built against Qt 4.8.7)

A potentially useful observation: I'm typing this message in KNode 4.13.3, the 
Usenet client from KDE PIM 4.13.3 . I can trigger the issue transiently in 
there:
- with the KNode message editor in focus, swap to another Plasma virtual desktop 
using the keyboard (say, Ctrl+F1) without moving the mouse
- swap back using a corresponding shortcut (say, Ctrl+F2) without moving the 
mouse

When focus is restored (automatically when Focus-follows-mouse) and I try to 
type an 'é', I get the "´e" sequence I also get when the issue has triggered.
I can restore behaviour by moving the mouse to put focus to any other 
application and then back to the KNode window.

I notice that the same applies to KMail4 (which is not a minimally ported Qt3 
app like KNode is).




R





More information about the Development mailing list