mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
LCL: fix TStringGrid OnKeyPress triggers twice at goEditing. Issue #41503
This commit is contained in:
parent
f29a74fde8
commit
4d4d4060a3
@ -7847,7 +7847,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomGrid.KeyPress(var Key: char);
|
procedure TCustomGrid.KeyPress(var Key: char);
|
||||||
|
const
|
||||||
|
keypressBusy:boolean=false;
|
||||||
begin
|
begin
|
||||||
|
if keypressbusy then
|
||||||
|
exit;
|
||||||
|
keypressBusy := true;
|
||||||
inherited KeyPress(Key);
|
inherited KeyPress(Key);
|
||||||
if not EditorKey then
|
if not EditorKey then
|
||||||
// we are interested in these keys only if they came from the grid
|
// we are interested in these keys only if they came from the grid
|
||||||
@ -7862,6 +7867,7 @@ begin
|
|||||||
Key := #0;
|
Key := #0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
keypressBusy := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Convert a physical Mouse coordinate into a physical cell coordinate }
|
{ Convert a physical Mouse coordinate into a physical cell coordinate }
|
||||||
|
@ -80,7 +80,7 @@ begin
|
|||||||
if S='' then WChar := WPARAM(Ord('?'))
|
if S='' then WChar := WPARAM(Ord('?'))
|
||||||
else WChar := WPARAM(S[1]);
|
else WChar := WPARAM(S[1]);
|
||||||
end;
|
end;
|
||||||
PostMessageW(AEditor.Handle, WM_CHAR, WChar, 0);
|
SendMessageW(AEditor.Handle, WM_CHAR, WChar, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user