QBasic 1.1: Declaring User Defined Keys

Syntax

KEY n%, CHR$(keyboardflag%) + CHR$(scancode%)

Description / Parameter(s)

n% A value in the range 15 through 25 that identifies the key.
keyboardflag% One of the following values, or a sum of values, specifying whether the user-defined key is used in combination with the Shift, Ctrl, Alt, NumLock, or Caps Lock keys, or with extended keys:
 
ValueKey
0No keyboard flag
1 through 3Either Shift key
4Ctrl key
8Alt key
32NumLock key
64Caps Lock key
128Extended keys on a 101-key keyboard
To specify multiple shift states, add the values together. For example, a value of 12 specifies that the user-defined key is used in combination with the Ctrl and Alt keys.
scancode% The scan code for the key being declared. See Keyboard Scan Codes.