Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month! GetIt Reference Guide - syntax: n_onshift([<procedurec>]) [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Syntax: N_ONSHIFT([<procedureC>])

Calls user-defined procedure when shift or lock key is pressed or released.

N_ONSHIFT() with no parameters returns current state of shift keys.


* Display current shift-lock status on screen.
Mattr = N_SAVEATTR()
Mstate = N_ONSHIFT()
@ 1,60 SAY IF("C"$Mstate,"Caps-Lock",SPACE(9))
@ 1,70 SAY IF("N"$Mstate,"Num-Lock",SPACE(8))


The following shift/lock keys are trapped when pressed or released: Alt,
Caps-Lock, Ctrl, Del, Ins, Num-Lock, Scroll-Lock, Shift-left, Shift-right.

The following shift/lock keys are trapped only when pressed: Del, Ins.

N_ONSHIFT("") with a null string disables N_ONSHIFT interruption.
Interrupts should be disabled while, or as soon as they are no longer

N_ONSHIFT() with no parameters returns the current shift state as a
character string.  The string will contain none, one or more of the
following characters:

     "A"  Alt key depressed          "R"   right-Shift key depressed
     "^"  Ctrl key depressed         "C"   Caps-lock active
     "I"  Ins-mode active  (*)       "N"   Num-lock active
     "S"  Scroll-lock active         "L"   left-Shift key depressed

N_ONSHIFT detects shift and lock keys only.  Use N_ANYKEY to detect other,
non-shift keys.

(*) Indicates state of Clipper Insert mode, which may not correspond to the
keyboard Insert mode.

See Also: N_ANYKEY

Online resources provided by: --- NG 2 HTML conversion by Dave Pearson