Skip to content

WaitKey

Narta Xaymar Dirks edited this page Nov 25, 2026 · 7 revisions

WaitKey BlitzBasic

WaitKey:Int32

Returns: The character code of the key that was typed.

Description

Stops the program until a character is typed and returns its character code. The window stays responsive while it waits, and keys that were typed before the call are ignored, so it always waits for a fresh key. Like GetKey it only reacts to keys that type a character, so Shift, Ctrl and the arrow keys do not end the wait.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Text 10, 10, "Press a key"
Flip
Local c = WaitKey()
Cls
Text 10, 10, "You typed code " + c
Flip
Delay 1000

Related Commands

GetKey BlitzBasic, KeyDown BlitzBasic, KeyHit BlitzBasic, KeyWait BlitzPlus, VKeyDown BlitzLLVM, VKeyHit BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally