Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GetIt Reference Guide - syntax: n_onshift([<procedurec>]) http://www.X-Hacker.org [<<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.

Example

* Display current shift-lock status on screen.
N_ONSHIFT("Shiftkey")
 ...
PROCEDURE Shiftkeys
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))
N_RESTATTR(Mattr)
RETURN

Notes

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
needed.

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: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson