Typing diactricics (using "dead keys") in TEdit does not trigger OnKeyDown or On(Utf8)KeyPress in QT-Linux
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
When you enter a diacritic into a TEdit (an many other controls) using the "dead keys" method there is no OnKeyDown or On(Utf8)KeyPress event triggered.
This is however not the case for TCustomControl derived controls like SynEdit.
By "dead keys" method I mean that in order to compose a "ó" I press 'o on the keyboard.
My Keyboard layout is
Map: US
Layout: English (US)
Variant: English (US, international with dead keys)
Steps to reproduce:
Attached sampleprogram shows that no OnKeyDown/OnUtf8KeyPress is triggered in TEdit when typing ó, but it is in TSynEdit
Additional information:
Looking in TQtWidget.SlotKey() this is what happens
Pressing 'o in a TEdit
------------------------------------
TQtWidget.SlotKey Edit2:TEdit
Text = ´
TQtWidget.SlotKey dump begin event=QEventKeyRelease
KEY=16781905 COUNT=2 TEXT=´
LCLKEY=0 SPONTANEOUS TRUE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 48 NATIVEVIRTUALKEY: 65105
Key compression ? TRUE
< TQtWidget.SlotKey dump end event=QEventKeyRelease
TQtWidget.SlotKey Edit2:TEdit
Text = o
TQtWidget.SlotKey dump begin event=QEventKeyRelease
KEY=79 COUNT=1 TEXT=o
LCLKEY=79 SPONTANEOUS TRUE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 32 NATIVEVIRTUALKEY: 111
Key compression ? TRUE
< TQtWidget.SlotKey dump end event=QEventKeyRelease
------------------------------------
Only KeyReleases are sent.
As opposed to:
Pressing a in a TEdit
------------------------------------
TQtWidget.SlotKey Edit2:TEdit
Text = a
TQtWidget.SlotKey dump begin event=QEventKeyPress
KEY=65 COUNT=1 TEXT=a
LCLKEY=65 SPONTANEOUS TRUE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 38 NATIVEVIRTUALKEY: 97
Key compression ? TRUE
< TQtWidget.SlotKey dump end event=QEventKeyPress
TQtWidget.SlotKey Edit2:TEdit
Text = a
TQtWidget.SlotKey dump begin event=QEventKeyRelease
KEY=65 COUNT=1 TEXT=a
LCLKEY=65 SPONTANEOUS TRUE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 38 NATIVEVIRTUALKEY: 97
Key compression ? TRUE
< TQtWidget.SlotKey dump end event=QEventKeyRelease
------------------------------------
Comparing this to a TSynEdit:
TSynEdit: typing 'o to compose ó:
------------------------------------
TQtWidget.SlotKey SynEdit1:TSynEdit
Text = ´
TQtWidget.SlotKey dump begin event=QEventKeyRelease
KEY=16781905 COUNT=2 TEXT=´
LCLKEY=0 SPONTANEOUS TRUE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 48 NATIVEVIRTUALKEY: 65105
Key compression ? FALSE
< TQtWidget.SlotKey dump end event=QEventKeyRelease
> TQtCustomControl.EventFilter event=QEventInputMethod
commmitString ó len 1 UnicodeChar 243 UnicodeLen 1
TQtWidget.SlotKey SynEdit1:TSynEdit
Text = ó
TQtWidget.SlotKey SynEdit1:TSynEdit
Text = ó
> TQtWidget.SlotKey dump begin event=QEventKeyPress
KEY=243 COUNT=1 TEXT=ó
LCLKEY=243 SPONTANEOUS FALSE
MODIFIERS: NONE NATIVEMODIFIERS: NONE
HASEXTENDEDINFO: FALSE ISAUTOREPEAT: FALSE
NATIVESCANCODE: 0 NATIVEVIRTUALKEY: 0
Key compression ? FALSE
< TQtWidget.SlotKey dump end event=QEventKeyPress
SynEdit1KeyDown: Key = 243
SynEdit1Utf8KeyPress: Utf8Key = ó
TQtWidget.SlotKey SynEdit1:TSynEdit Text = o > TQtWidget.SlotKey dump begin event=QEventKeyRelease KEY=79 COUNT=1 TEXT=o LCLKEY=79 SPONTANEOUS TRUE MODIFIERS: NONE NATIVEMODIFIERS: NONE HASEXTENDEDINFO: TRUE ISAUTOREPEAT: FALSE NATIVESCANCODE: 32 NATIVEVIRTUALKEY: 111 Key compression ? FALSE < TQtWidget.SlotKey dump end event=QEventKeyRelease ------------------------------------
Attached patch moves the handling of QEventInputMethod events to QtWidget.EventFilter and fixes the issue
Mantis conversion info:
- Mantis ID: 26115
- OS: Linux
- OS Build: Fedora Core 18
- Build: r44929
- Platform: i386
- Version: 1.3 (SVN)
- Fixed in revision: r44930 (#00158cb5)