Skip to content

WaitKey

Narta Xaymar Dirks edited this page Nov 1, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

WaitKey

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, KeyDown, KeyHit, KeyWait, VKeyDown, VKeyHit

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally