IsNumpadKeyDown

From SCAR Divi Manual
Revision as of 15:12, 10 November 2012 by Freddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

See Also