
February 24th, 2004, 12:34 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Trap the OnKeyPress event for the form, check what key has been pressed and act accordingly. The OnKeyPress event occurs once for each keystroke.
Code:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
var
ch : char;
begin
ch := Upcase(Key);
case ch of
'A':
DoSomething;
'S':
DoSomethingElse;
'D':
DoSomethingStrange;
else
DoDefaultAction;
end;
end;
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|