Simon180 -3 Light Poster

Hey daniweb,

I have a small problem am looking to add a shortcut key using control key and it will act like a button but the problem is I been trying to make it so you must have the control key pressed down to keep the funcation active but it shud only call the command once and when you release the control key it will free the process up any ideas?

procedure TMainForm.ApplicationEventsShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
if GetKeyState(VK_CONTROL) < 0 then
    CtrlKeyDown
  else
    CtrlKeyUp;
end;

thanks very much :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.