mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 12:39:15 +02:00
LCL, grids, allow the RETURN key to go to OnKeyPress
git-svn-id: trunk@42992 -
This commit is contained in:
parent
6ab0ade4ee
commit
60927657c9
@ -7711,13 +7711,6 @@ begin
|
||||
{$ifdef dbgGrid}DebugLn('Grid.EditorKeyDown Key=',dbgs(Key),' INIT');{$endif}
|
||||
FEditorKey:=True; // Just a flag to see from where the event comes
|
||||
KeyDown(Key, shift);
|
||||
if Key = VK_RETURN then begin
|
||||
Key := 0;
|
||||
Include(FGridFlags, gfEditingDone);
|
||||
if not MoveNextAuto(ssShift in Shift) then
|
||||
ResetEditor;
|
||||
Exclude(FGridFlags, gfEditingDone);
|
||||
end;
|
||||
FEditorKey:=False;
|
||||
{$ifdef dbgGrid}DebugLn('Grid.EditorKeyDown Key=',dbgs(Key),' END');{$endif}
|
||||
end;
|
||||
@ -7740,7 +7733,16 @@ begin
|
||||
{$ifdef dbgGrid}DebugLn('Grid.EditorKeyPress: inter Key=',PrintKey);{$Endif}
|
||||
case Key of
|
||||
^C,^V,^X:;
|
||||
^M, #27: Key:=#0; // key is already handled in KeyDown
|
||||
|
||||
^M:
|
||||
begin
|
||||
Include(FGridFlags, gfEditingDone);
|
||||
if not MoveNextAuto(GetKeyState(VK_SHIFT) < 0) then
|
||||
ResetEditor;
|
||||
Exclude(FGridFlags, gfEditingDone);
|
||||
Key := #0;
|
||||
end;
|
||||
|
||||
else begin
|
||||
AChar := Key;
|
||||
if not EditorCanAcceptKey(AChar) or EditorIsReadOnly then
|
||||
|
Loading…
Reference in New Issue
Block a user