X"B0" function 2

Tests the status of the Shift, Alt, Ctrl and Lock keys.

Syntax:
call X"B0" using function-code
                 status-block
Parameters:
Using call prototype (see Library Routines - Key) Picture (32-bit systems)
function-code cblt-x1-compx pic x comp-x.
status-block Group containing: Group containing:
  status-inds   pic x   pic x
  status-id   cblt-x1-compx   pic x comp-x.
  status-res   pic x(6)   pic x(6)
On Entry:
function-code Value 2.
status-id Must be set to 2. It is overwritten by the call, so must be reset to 2 before each call.
status-res Reserved.
On Exit:
status-inds Contains bit settings indicating the status of the keys (1=key pressed, 0=key not pressed) in the following order:
bit 7 Ins
bit 6 Caps Lock
bit 5 Num Lock
bit 4 Scroll Lock
bit 3 Alt
bit 2 Ctrl
bit 1 Shift (left key only)
bit 0 Shift (right key only)
Comments:

For the Alt, Ctrl and Shift keys, the routine returns a 1 only if the key is actually pressed when the routine is called; for the other keys, the relevant bit is alternately set and unset each time the key is pressed.

Effective use of function 2 requires that the call is repeated at very frequent intervals.

Keyboard Routines - Example

See Also: