Difference between revisions of "IsNumpadKeyDown"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function IsNumpadKeyDown(Key: Byte): Boolean; </source> ===Source Code=== <source lang="scar"> function IsNumpadKeyDown(Key: By...") |
|||
| Line 22: | Line 22: | ||
==Availability== | ==Availability== | ||
| − | SCAR Divi 3. | + | SCAR Divi 3.34 > Current |
==Description== | ==Description== | ||
| Line 47: | Line 47: | ||
*[[IsKeyDown]] | *[[IsKeyDown]] | ||
| − | [[Category: | + | [[Category:Deprecated Functions]] |
| − | |||
Latest revision as of 15:12, 10 November 2012
Definition
function IsNumpadKeyDown(Key: Byte): Boolean;
Source Code
function IsNumpadKeyDown(Key: Byte): Boolean;
var
pKey: Byte;
begin
if Key < 10 then
pKey := 96 + Key
else
case Key of
10: pKey := VK_NUMLOCK;
else Exit(False);
end;
Result := (pKey < 11) and (GetAsyncKeyState(pKey) <> 0);
end;Availability
SCAR Divi 3.34 > Current
Description
Returns true if a numpad key specified by Key was pressed.
Keys
- 0-9: Numpad keys 0 to 9
- 10: Numlock
Example
begin
repeat
Wait(500)
until IsNumpadKeyDown(2);
WriteLn('Pressed numpad key 2');
end.