On 10/31/2014 04:14 PM, Fabio Luis Girardi wrote:
Hello!!

I'm doing a virtual keyboard for lazarus using the LCLMessageGlue unit, but methods
LCLSendKeyUpEvent and LCLSendKeyDownEvent are not working.

So, what's the current status of LCLMessageGlue unit?
--
The best regards,

Fabio Luis Girardi
PascalSCADA Project
http://sourceforge.net/projects/pascalscada
http://www.pascalscada.com

Sorry for the late reply. I stumbled on this question in a google search.

SHORT VERSION:
Methods in LCLMessageGlue are not intended for nor should they be used directly in user programs or the results could be unexpected.

LONG VERSION:
The LCLMessageGlue unit is only meant to simplify sending messages to the lcl as the result of an actual change in the underlying widgetset(gtk, qt win32, etc). Using the methods directly in your program won't actually cause a change but will probably trigger the event for the message you send.

For instance if you used LCLSendClickedMsg(MyButton) the OnClick event would be triggered but the button would not visibly react.

Using LCLSendKey[Up/Down]Event won't work the way you want because the widgetset (gtk, qt, win32, etc) is actually managing the text content of the component. i.e. the LCL isn't doing Text:=Text+NewChar for every keypress event, the widgeset is responsible for that. Exceptions to this could be custom controls implemented fully in the LCL like TTreeView and TSynEdit.

Regards,

Andrew Haines

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to