LCLSendUTF8KeyPress AUTF8Char parameter anomaly
What happens
By 'lagprogramming' from forum.
lcl/lclmessageglue.pas contains the following functions:
function LCLSendKeyDownEvent(const Target: TControl; var CharCode: Word; KeyData: PtrInt; BeforeEvent, IsSysKey: Boolean): PtrInt;
function LCLSendKeyUpEvent(const Target: TControl; var CharCode: Word; KeyData: PtrInt; BeforeEvent, IsSysKey: Boolean): PtrInt;
function LCLSendCharEvent(const Target: TControl; var CharCode: Word; KeyData: PtrInt; BeforeEvent, IsSysKey, ANotifyUserInput: Boolean): PtrInt;
function LCLSendUTF8KeyPress(const Target: TWinControl; AUTF8Char: TUTF8Char; IsSysKey: Boolean): PtrInt;
....
function LCLSendUTF8KeyPress(const Target: TWinControl; AUTF8Char: TUTF8Char;
IsSysKey: Boolean): PtrInt;
begin
{if not IsControlKey then}
Target.IntfUTF8KeyPress(AUTF8Char, 1, IsSysKey);
Result := 1;
end;
Why LCLSendUTF8KeyPress doesn't have a "var" before "AUTF8Char: TUTF8Char;"
, similar to "var CharCode: Word;"
? Especially because AUTF8Char in "Target.IntfUTF8KeyPress(AUTF8Char, 1, IsSysKey);"
points to:
function IntfUTF8KeyPress(var UTF8Key: TUTF8Char; RepeatCount: Integer; SystemKey: Boolean): Boolean; virtual;
To me it doesn't look right. Are you sure there shouldn't be a "var" before "AUTF8Char: TUTF8Char;"
at function LCLSendUTF8KeyPress?
Edited by Alexey Torgashin