ConInShift function

 

Usage:

Bitmask& = ConInShift

 

Legacy Syntax:

Bitmask& = INSHIFT

 

Pseudo-object Syntax:

Bitmask& = CON.INSHIFT

 

Returns the state of the keyboard shift and lock keys.

 

The value returned is a bitmask indicating the state of the keyboard Shift, Ctrl, Alt and lock keys, as of the last keystroke or mouse event returned by ConInKey$ or ConWaitKey$:

 

  1 = Right-Alt         32 = Num Lock

  2 = Left-Alt          64 = Scroll Lock

  4 = Right-Ctrl       128 = Caps Lock

  8 = Left-Ctrl        256 = Enhanced Key

 16 = Shift

 

Values can be combined. For example, a return value of 17 would indicate that the right-alt and shift keys were both pressed.

 

The flags can be tested using the standard Windows API constants:

 

 %RIGHT_ALT_PRESSED

 %LEFT_ALT_PRESSED

 %RIGHT_CTRL_PRESSED

 %LEFT_CTRL_PRESSED

 %SHIFT_PRESSED

 %NUMLOCK_ON

 %SCROLLLOCK_ON

 %CAPSLOCK_ON

 %ENHANCED_KEY

 

Conversion:

 

#IF %DEF(%PB_CC32)

  Bitmask& = INSHIFT

#ELSE

  Bitmask& = ConInShift

#ENDIF

 

CON.INSHIFT or CONSOLE.INSHIFT may be substituted for INSHIFT in programs written for PB/CC6.

 

See also: ConInKey$, ConWaitKey$