Skip to content

FlushKeys

Narta Xaymar Dirks edited this page Oct 30, 2026 · 8 revisions

Blitz3DBlitzPlusBlitzBasic

FlushKeys

FlushKeys:Void

Description

Throws away everything the keyboard has recorded so far: the queue of typed characters that GetKey hands out, the keys counted as held for KeyDown and the presses counted for KeyHit. Call it once before a screen that waits for input, such as a menu or a new level, so that button mashing from the previous screen does not skip it. Do not call it every frame, or the program will never see a key.

Differences

  • The Device argument is a BlitzLLVM extension: the original has no such argument and only knows one keyboard.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Text 10, 10, "Mash the keys for a moment..."
Flip
Delay 2000
FlushKeys
Cls
Text 10, 10, "Everything typed so far is forgotten."
Text 10, 30, "Press any key to leave."
Flip
WaitKey

Related Commands

GetKey, KeyboardChanged

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally