Important: The information in this document is obsolete and should not be used for new development.
GetKeys
You can use theGetKeys
procedure to obtain the current state of the keyboard.
PROCEDURE GetKeys (VAR theKeys: KeyMap);
- theKeys
- Returns the current state of the keyboard, including the keypad, if any. The
GetKeys
procedure returns this information using theKeyMap
data type.TYPE KeyMap = PACKED ARRAY[0..127] OF Boolean;
- Each key on the keyboard or keypad corresponds to an element in the
KeyMap
array. The index for a particular key is the same as the key's virtual key code minus 1. For example, the key with virtual key code 38 (the "J" key on the Apple Keyboard II) can be accessed asKeyMap[37]
in the returned array. AKeyMap
element isTRUE
if the corresponding key is down andFALSE
if it isn't. The maximum number of keys that can be down simultaneously is two character keys plus any combination of the five modifier keys.DESCRIPTION
You can use theGetKeys
procedure to determine the current state of the keyboard at any time. For example, you can determine whether one of the modifier keys is down by itself or in combination with another key using theGetKeys
procedure.