Hello,
I´m trying to have my app respond to key pressing, so I set an event for
the OnKeyDown event of the form. The code works very well on Delphi.
Does not work on Lazarus.
Something else, possibly related, is that on the latest snapshot 18
dezember, the Code Explorer does not respond to key events. If you press
the down arrow it won´t go to the method bellor for example. and Enter
also does not take you directly to the source ... you have to use the
mouse to work with the Code Explorer.
Here is the method:
procedure TMainWindow.HandleKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_LEFT: SetCursorPos(Mouse.CursorPos.X - 5, Mouse.CursorPos.Y);
VK_RIGHT: SetCursorPos(Mouse.CursorPos.X + 5, Mouse.CursorPos.Y);
VK_UP: SetCursorPos(Mouse.CursorPos.X, Mouse.CursorPos.Y - 5);
VK_DOWN: SetCursorPos(Mouse.CursorPos.X, Mouse.CursorPos.Y + 5);
VK_PRIOR: SetCursorPos(Mouse.CursorPos.X, Mouse.CursorPos.Y - 50);
// Page Up
VK_NEXT: SetCursorPos(Mouse.CursorPos.X, Mouse.CursorPos.Y + 50);
// Page Down
VK_ESCAPE: HideWindow(Self);
VK_RETURN: HideWindow(Self);
{*******************************************************************
* The sender parameter is used to tell the procedure to enlarge or
decrease the Len size
*******************************************************************}
VK_ADD: vConfigurations.iMagnification :=
vConfigurations.iMagnification + 0.5;
VK_SUBTRACT: vConfigurations.iMagnification :=
vConfigurations.iMagnification - 0.5;
end;
// Hard limits for the magnification
if vConfigurations.iMagnification = 0.5 then
vConfigurations.iMagnification := 1.0
else if vConfigurations.iMagnification > 16 then
vConfigurations.iMagnification := 16;
vGlass.Invalidate;
end;
thanks,
Felipe
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives