Difference between revisions of "IsArrowDown"

From SCAR Divi Manual
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function IsArrowDown(Num: Byte): Boolean;
+
function IsArrowDown(const Num: Byte): Boolean;
 
</source>
 
</source>
  
Line 19: Line 19:
  
 
==Availability==
 
==Availability==
SCAR Divi 3.00 > Current
+
SCAR Divi 3.00 > 3.34
  
 
==Description==
 
==Description==
Line 46: Line 46:
 
*[[IsKeyDown]]
 
*[[IsKeyDown]]
  
[[Category:Functions]]
+
[[Category:Deprecated Functions]]
[[Category:Keyboard Functions]]
 

Latest revision as of 15:08, 10 November 2012

Definition

function IsArrowDown(const 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 > 3.34

Description

Returns true if an arrow key specified by Num was pressed.

Keys

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

Example

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

See Also