Not sure what you mean, can you expain more?
Maybe something like this?
[pascal]procedure TFormGame.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = vk_Escape then
application.Terminate;
end;[/pascal]
Where vk can be any of the following:
{ Virtual Keys, Standard Set }
{$EXTERNALSYM VK_LBUTTON}
VK_LBUTTON = 1;
{$EXTERNALSYM VK_RBUTTON}
VK_RBUTTON = 2;
{$EXTERNALSYM VK_CANCEL}
VK_CANCEL = 3;
{$EXTERNALSYM VK_MBUTTON}
VK_MBUTTON = 4; { NOT contiguous with L & RBUTTON }
{$EXTERNALSYM VK_BACK}
VK_BACK = 8;
{$EXTERNALSYM VK_TAB}
VK_TAB = 9;
{$EXTERNALSYM VK_CLEAR}
VK_CLEAR = 12;
{$EXTERNALSYM VK_RETURN}
VK_RETURN = 13;
{$EXTERNALSYM VK_SHIFT}
VK_SHIFT = $10;
{$EXTERNALSYM VK_CONTROL}
VK_CONTROL = 17;
{$EXTERNALSYM VK_MENU}
VK_MENU = 18;
{$EXTERNALSYM VK_PAUSE}
VK_PAUSE = 19;
Etc.
Or :
[pascal]procedure TForm1.Button1Click(Sender: TObject);
var
hTaskBar : THandle;
begin
// If you want to detect a letter you must use the ascii code.
//detect the "a and the A letter".
if GetasyncKeyState(65)<>0 then Caption:='A';
if GetasyncKeyState(97)<>0 then Caption:='a';
// If you want to detect the left button of the mouse use:
if GetasyncKeyState(1)<>0 'mouse
end;
//To detect a key you must use the Virtual key codes..
if GetasyncKeyState(vk_space)<>0 then Caption:='Spacebar';
[/pascal]
Bookmarks