CN_SYSCHAR not handled by LCL => some keys don't work in GTK2 SynEdit
Original Reporter info from Mantis: Giulio
-
Reporter name: Giulio Bernardi
Original Reporter info from Mantis: Giulio
- Reporter name: Giulio Bernardi
Description:
As you can see here:
http://frontype.com/keyboarding/540px-Computer-keyboard-Italian.svg.png
on italian keyboards { and } keys are inserted by pressing "Alt Gr" + "Shift" + "è" and "Alt Gr" + "Shift" + "+" respectively. [ and ] keys are inserted with "Alt Gr" + "è" and "Alt Gr" + "+".
Now, while [ and ] work perfectly, on GTK2 SynEdit trying to input { and } does nothing.
After tracing the issue, I discovered that in HandleGTKKeyUpDown (gtk2proc.inc) pressing "Alt Gr" and "Shift" (but not "Alt Gr" alone) causes SysKey to be true: for this reason, when IntfUTF8KeyPress is invoked on the target, no action is performed.
The execution continues where the comment line "send the (Sys)Char message directly (not queued) to the LCL" is, and the message is delivered to the LCL. But since SysKey is true, the delivered message is CN_SYSCHAR, but TWinControl does not handle that, so nothing happens.
I tried to brutally add a CNSysChar method to TWinControl that simply calls CNChar, and now I am able to input { and } in my application. Now I can also enter "{" (but not "}", I don't know why) in lazarus IDE.
Note that other controls (like TEdit) can receive "{" and "}" without problems.
Steps to reproduce:
I think that if you change your keyboard layout to Italian and try to input "{" in lazarus Source Editor you may experience the problem too.
Mantis conversion info:
- Mantis ID: 22703
- OS: Linux x86_64
- OS Build: Fedora 16
- Build: rev 38329
- Platform: Linux x86_64, fpc 2.6.0
- Version: 1.1 (SVN)
- Fixed in revision: 44507 (#2a1f15b8)