Malcom,
        I had tried mixing the virtual key code and GetkeyState together as
you show but of course it didn't work until I saw your example and added the
rest of the evaluation: "and $80)>0".  That did the trick, unfortunately I
don't know exactly what it is you are doing here.  It seems like you are
checking to see if the F1 Key is down, but if so then why is "if
(key=VK_F1)" even necessary?  Wouldn't it be redundant as this is in the
OnKeyDown event?

from Robert Meek dba Tangentals Design  CCopyright 2006

"When I examine myself and my methods of thought, I come to the conclusion
that the gift of Fantasy has meant more to me then my talent for absorbing
positive knowledge!"
                                                    Albert Einstein


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Malcolm Clark
Sent: Monday, April 24, 2006 6:03 AM
To: Borland's Delphi Discussion List
Subject: Re: Virtual key codes

 >I've already tried, "if (key = VK_SHIFT) and (VK_F1) then",
 >but this doesn't work for the Form or the Listview either. Any ideas?

procedure TForm1.ListView1KeyDown(Sender: TObject;
                              var Key: Word;
                              Shift: TShiftState);
begin
  if (key=VK_F1) and
    ((Windows.GetKeyState(VK_SHIFT) and $80)>0) then
    ShowMessage('Bingo!')
end;

-malcolm
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to