IsArrowDown

From SCAR Divi Manual
Revision as of 16:34, 4 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function IsArrowDown(Num: Byte): Boolean; </source> ===Source Code=== <source lang="scar"> function IsArrowDown(Num: Byte): Boo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function IsArrowDown(Num: Byte): Boolean;

Source Code

function IsArrowDown(Num: Byte): Boolean;
begin
  Result := False;
  case Num of
    0: Result := GetAsyncKeyState(VK_UP) <> 0;
    1: Result := GetAsyncKeyState(VK_RIGHT) <> 0;
    2: Result := GetAsyncKeyState(VK_DOWN) <> 0;
    3: Result := GetAsyncKeyState(VK_LEFT) <> 0;
  end;
end;

Availability

SCAR Divi 3.00 > Current

Description

Returns true if an arrow specified by Num was pressed.

Keys (Num)

  • 0: Up
  • 1: Right
  • 2: Down
  • 3: Left

Example

begin
  repeat
    Wait(500)
  until IsArrowDown(2);
  WriteLn('Pressed down');
end.

See Also