Skip to content

VKeyDown

Narta Xaymar Dirks edited this page Nov 1, 2026 · 1 revision

VKeyDown

VKeyDown:Int32 scancode:Int32
Parameter Mode Type Default Description
scancode In Int32 required The SDL scancode of the key, 1 to 511.

Returns: 1 while the key is held down, otherwise 0.

Description

Tells whether a key is held down right now, asking for the key by its SDL scancode instead of the DirectInput code that KeyDown takes. Every key has an SDL scancode (F16 is 107, Pause is 72, the left Windows key is 227), so this reaches the keys that KeyDown cannot. The codes are the same on every platform and do not change with the keyboard layout. See Scan Codes for the table.

Differences

  • This is a BlitzLLVM extension: the original has no such command.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
While Not KeyHit(1)
	Cls
	Text 10, 10, "Press F16 (SDL scancode 107), Escape ends"
	If VKeyDown(107) Then Text 10, 30, "F16"
	Flip
Wend

Related Commands

GetKey, KeyDown, KeyHit, KeyWait, VKeyHit, WaitKey

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally