mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 07:18:14 +02:00
Cocoa: Fix #40985, enter the edit state in KeyDown()
This commit is contained in:
parent
8692ed1de5
commit
dcacf7aaac
@ -150,6 +150,24 @@ begin
|
||||
if not FieldIsEditable(FDatalink.Field) or not FDataLink.Edit then
|
||||
Key := VK_UNKNOWN;
|
||||
end;
|
||||
{$IFDEF DARWIN}
|
||||
// the code for macOS here has been carefully considered
|
||||
// and must be specially handled here.
|
||||
// on macOS, because of the special key processing mechanism
|
||||
// and the various possibilities combined with IME,
|
||||
// we need to enter the editing state in KeyDown().
|
||||
// if we enter the edit state in KeyPress(), it is too late
|
||||
// and will cause the Memo content to change, leading to the issue #40985
|
||||
VK_0..VK_9,
|
||||
VK_A..VK_Z,
|
||||
VK_NUMPAD0..VK_DIVIDE,
|
||||
VK_OEM_1..VK_OEM_3,
|
||||
VK_OEM_4..VK_OEM_8:
|
||||
begin
|
||||
if not FDatalink.Edit then
|
||||
Key:= 0;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user