Keyget Command

Purpose

Gets the first character in the keyboard buffer.

Syntax

Keyget n

Description

Keyget n% waits for a key press and returns in n% a long word with the following layout:

Bit 0 to 7 - ASCII code

Bit 8 to 15 - Scan code

For a list of Scan and ASCII codes, see Key Codes and ASCII Values.

Example

Local n%

OpenW # 1

Print "Press any key"

KeyGet n%

Print Hex$(n%, 4)

Waits for key entry and then returns the codes of the pressed key.

Remarks

During the waiting period for a key to hit, GFA-BASIC 32 doesn't block other programs, but performs a DoEvents.

See Also

Inkey$, KeyTest

{Created by Sjouke Hamstra; Last updated: 11/10/2014 by James Gaite}