Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>keyboard</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 KEYBOARD
 Stuff a string into the keyboard buffer
------------------------------------------------------------------------------
 Syntax

     KEYBOARD <cString>

 Arguments

     <cString> is the string to stuff into the keyboard buffer.

 Description

     KEYBOARD is a keyboard command that stuffs <cString> into the keyboard
     buffer after clearing any pending keystrokes.  The characters remain in
     the keyboard buffer until fetched by a wait state such as ACCEPT, INPUT,
     READ, ACHOICE(), MEMOEDIT(), and DBEDIT(), or INKEY().  In addition to
     display characters, <cString> may include control characters.

     Generally, to convert an INKEY() code of a control key to a character
     value, use CHR().  There are, however, some limitations.  You can only
     stuff characters with INKEY() codes between zero and 255, inclusive,
     into the keyboard buffer.

     Typically, KEYBOARD is used in a SET KEY procedure to reassign keys in a
     wait state.  Another use within the ACHOICE() user function is to input
     the keys you want ACHOICE() to execute before returning control to it.
     The same concept applies to DBEDIT().

 Examples

     .  This example uses KEYBOARD to stuff a GET with an item
        selected from a picklist each time the GET is entered:

        #include "Inkey.ch"
        LOCAL cVar1 := SPACE(10), nVar := 2500, ;
              cVar2 := SPACE(10)
        CLEAR
        @ 09, 10 GET cVar1
        @ 10, 10 GET cVar2 WHEN PickList()
        @ 11, 10 GET nVar
        READ
        RETURN

        FUNCTION PickList
           STATIC aList := { "First", "Second", ;
              "Three", "Four" }
           LOCAL cScreen, nChoice, nKey := LASTKEY()
           cScreen := SAVESCREEN(10, 10, 14, 20)
           @ 10, 10 TO 14, 20 DOUBLE
           IF (nChoice := ACHOICE(11, 11, 13, 19, aList)) != 0
              KEYBOARD CHR(K_CTL_Y) + aList[nChoice] + ;
                    CHR(nKey)

           ENDIF
           RESTSCREEN(10, 10, 14, 20, cScreen)
           RETURN .T.

 Files:  Library is CLIPPER.LIB, header file is Inkey.ch.

See Also: CHR() INKEY() LASTKEY() NEXTKEY() SET KEY

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson