Stuff a string into the keyboard buffer

     KEYBOARD <cString>


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


     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().


     .  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)
        @ 09, 10 GET cVar1
        @ 10, 10 GET cVar2 WHEN PickList()
        @ 11, 10 GET nVar

        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] + ;

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

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



6 responses to “C5_KEYBOARD

  1. Pingback: C5 UI General | Viva Clipper !

  2. Pingback: C5_SET TYPEAHEAD | Viva Clipper !

  3. Pingback: C5_SET KEY | Viva Clipper !

  4. Pingback: C5_SET FUNCTION | Viva Clipper !

  5. Pingback: C5 User Interface | Viva Clipper !

  6. Pingback: C5 Commands | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.