NextKey()

NEXTKEY()

Get the next key code in the buffer without extracting it.

Syntax

      NEXTKEY( [<nInputMask>] ) --> nKey

Arguments

nInputMask is an optional integer value composed of one or more INKEY_ or HB_INKEY_ constants. The sole purpose of this argument is to allow switching between using HB_INKEY_EXTENDED key codes and using the normal CA-Cl*pper-compatible key codes

Returns

<nKey> The value of the next key in the Harbour keyboard buffer.

Description

Returns the value of the next key in the Harbour keyboard buffer without extracting it.

Examples

      // Use NEXTKEY() with INKEY() to change display characters, or by
      // itself to exit the loop, so that the caller can detect the Esc.
      LOCAL nKey, cChar := "+"
      DO WHILE .T.
         ?? cChar
         nKey := NextKey()
         IF nKey == K_ESC
            EXIT
         ELSE
            IF nKey != 0
               cChar := Chr( nKey )
            ENDIF
         ENDIF
      ENDDO

Tests

      KEYBOARD "AB"; ? NEXTKEY(), NEXTKEY() ==>   65   65

Compliance

NEXTKEY() is compliant with CA-Cl*pper 5.3, but has been extended for Harbour.

Files

Library is rtl

Seealso

INKEY(), LASTKEY()

3 responses to “NextKey()

  1. Pingback: Harbour All Functions – N | Viva Clipper !

  2. Pingback: Harbour UI – Input Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | 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.