Previous: TestShift function To the Table of Content Next: LM Unit

- 4.41.2.13 -
Standard Units
Keyboard Unit
Keyboard Unit Procedures and Functions

TestKey

Targets: MS-DOS, Win32 console


Keyboard Unit

Checks the state of a key with a given scan code.

Declaration:
function TestKey(Scan: Byte): Boolean;
Remarks:
The TestKey function returns TRUE if the key with the given scan code is pressed, FALSE otherwise. This function works in multi-keys mode only (see MultikeysInit).

Example:
{$ifndef __CON__}
  This program must be compiled as an MS-DOS or Win32
  console application
{ $endif}
uses Keyboard;
begin
  MultikeysInit;
  Writeln('Press [Esc]+[Space] to exit..');
  repeat  (* Wait loop *)
  until (TestKey(Space_Scan) and TestKey(Esc_Scan));
  Writeln('Ok.');
  MultikeysDone;
end.



Previous: TestShift function To the Table of Content Next: LM Unit
TestShift function Table of Content LM Unit

- 4.41.2.13 -