User Tools

Site Tools


keystate_return_keyboard_status_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== KEYSTATE (return keyboard status) ====== Previous pageReturn to chapter overviewNext page

KEYSTATE( )

The KEYSTATE procedure returns a bitmap containing the status of the SHIFT, CTRL, ALT, any extended key, CAPS LOCK, NUM LOCK, SCROLL LOCK, and INSERT keys for the last KEYCODE procedure return value. The bitmap is contained in the high-order byte of the returned SHORT.

x . . . . . . .  insert key  (8000h)

. x . . . . . .  scroll lock (4000h)

. . x . . . . .  num lock    (2000h)

. . . x . . . .  caps lock   (1000h)

. . . . x . . .  extended    (0800h)

. . . . . x . .  alt         (0400h)

. . . . . . x .  ctrl        (0200h)

. . . . . . . x  shift       (0100h)

Return Data Type: UNSIGNED

Example:

ACCEPT                       !Loop on the display

CASE KEYCODE()              !Process the keystroke

OF EnterKey                 !User pressed Enter

 IF BAND(KEYSTATE(),0800h)  !Detect enter on numeric keypad

  PRESSKEY(TabKey)          !press tab for the user

 END

END

END

See Also:

KEYCODE

BAND

Keycode Equates List

keystate_return_keyboard_status_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1