[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
KEY                      Set or Display Soft Keys

 KEY {ON | OFF | LIST}
 KEY n, strexpr
 KEY n, CHR$(KBflag) + CHR$(scancode)

    Controls the display and contents of the function keys F1 through F10;
    allows trapping of any scan code in any shift state.

          ON    KEY ON enables the display, on line 25, of current
                function key settings. Only the first six character
                assigned to each function key are displayed. If the screen
                is in an 80-column display mode, all ten function keys are
                displayed; if it's in a 40-column mode, the first five are
                displayed. KEY ON is the default setting in BASIC.

         OFF    KEY OFF removes the function key display from line 25,
                making line 25 available for other purposes. With KEY OFF
                in effect, a LOCATE 25,n can be used to display other text
                at the bottom of the screen. Line 25 does not scroll, but
                it is erased by a CLS statement.

        LIST    KEY LIST displays the current soft key definitions on
                screen.

  n, strexpr    KEY n, strexpr assigns the string expression strexpr to
                function key n. n is a numeric expression in the range 1
                to 10. Only the first 15 characters of strexpr are
                significant. A null string strexpr deactivates the
                associated function key.

n, CHR$(KBflag) + CHR$(scancode)
                The statement KEY n, CHR$(KBflag) + CHR$(scancode) enables
                your program to trap specified Ctrl keys, Alt keys, and
                Shifted keys. n is a numeric expression in the range 15 to
                20 (up to six traps may be in effect at once). KBflag,
                which must be expressed in hexadecimal, specifies the
                shift state of the key to be trapped, and scancode
                specifies which alphanumeric key is to be trapped.

                The following options are available for KBflag:

                    &H40      Caps Lock active
                    &H20      Num Lock active
                    &H08      Alt key pressed
                    &H04      Ctrl key pressed
                    &H02      Left Shift key pressed
                    &H01      Right Shift key pressed
                    &H00      Caps Lock inactive, Num Lock inactive

                These options may be used in additive fashion, to trap
                combinations of shift states. For example,
                CHR$(&H08+&H02+&H01) would catch the combination of the
                Alt key with either (or both) Shift keys.

                Trapped keys do not enter the BIOS keyboard buffer.
                Therefore, if either Ctrl-Break or Ctrl-Alt-Del is
                trapped, there will be no way (other than powering down)
                to break out of an infinite loop.

See Also: KEY(n) ON KEY
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson