Function KbdStat() Foundation

Determines the state of special keys like Shift, Ctrl or Alt

Syntax
KbdStat() --> nKeyState
Return

The function returns always 0 under Windows 95.

The insert key is not supported under Windows NT. Scroll-Lock, Caps-Lock and Num-Lock are only detected when the corresponding keyboard mode is enabled.

The function returns a numeric value that indicates which special key is pressed at a time. #define constants to identify a key are found in XBTKBD.CH. If multiple keys are pressed at the same time the return value is a sum of these constants:

Return values of KbdStat()
Constant Description
KST_RIGHTSHIFT Right Shift key pressed
KST_LEFTSHIFT Left Shift key pressed
KST_CTRL Either Ctrl key pressed
KST_ALT Either Alt key pressed
KST_SCROLLOCK Scroll lock active
KST_NUMLOCK Num lock active
KST_CAPSLOCK Caps lock active
KST_INSERT Insert mode active
KST_LEFTCTRL Left Ctrl key pressed
KST_LEFTALT Left Alt key pressed
KST_RIGHTCTRL Right Ctrl key pressed
KST_RIGHTALT Right Alt key pressed
KST_SCROLL Scroll lock pressed
KST_NUM Num lock pressed
KST_CAPS Caps lock pressed
KST_SYSRQ SysRequest pressed

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.