mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 04:35:57 +02:00
carbon: change keyboard event character only when necessary
git-svn-id: trunk@24502 -
This commit is contained in:
parent
7529f8e591
commit
ec8f1f4868
@ -678,6 +678,7 @@ const
|
|||||||
var
|
var
|
||||||
KeyMsg: TLMKeyDown;
|
KeyMsg: TLMKeyDown;
|
||||||
CharMsg: TLMChar;
|
CharMsg: TLMChar;
|
||||||
|
OrigChar: AnsiString;
|
||||||
begin
|
begin
|
||||||
Result:=EventNotHandledErr;
|
Result:=EventNotHandledErr;
|
||||||
{$IFDEF VerboseKeyboard}
|
{$IFDEF VerboseKeyboard}
|
||||||
@ -740,6 +741,7 @@ const
|
|||||||
if SendChar then
|
if SendChar then
|
||||||
begin
|
begin
|
||||||
// send the UTF8 keypress
|
// send the UTF8 keypress
|
||||||
|
OrigChar:=UTF8Character;
|
||||||
if TWinControl(Widget.LCLObject).IntfUTF8KeyPress(UTF8Character,1,IsSysKey) then
|
if TWinControl(Widget.LCLObject).IntfUTF8KeyPress(UTF8Character,1,IsSysKey) then
|
||||||
begin
|
begin
|
||||||
// the LCL has handled the key
|
// the LCL has handled the key
|
||||||
@ -750,7 +752,8 @@ const
|
|||||||
Result := noErr;
|
Result := noErr;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
LCLCharToMacEvent(UTF8Character);
|
if OrigChar<>UTF8Character then
|
||||||
|
LCLCharToMacEvent(UTF8Character);
|
||||||
|
|
||||||
// create the CN_CHAR / CN_SYSCHAR message
|
// create the CN_CHAR / CN_SYSCHAR message
|
||||||
FillChar(CharMsg, SizeOf(CharMsg), 0);
|
FillChar(CharMsg, SizeOf(CharMsg), 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user