Skip to content

EventData

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

EventData

EventData:Int32

Returns: The data of the event, see the table. Keeps its value until the next call of WaitEvent.

Description

Gives the extra number of the event that WaitEvent took last. What it means depends on the kind of event:

Event ID Data Source X / Y / Z
KeyDown $101 Scan code - -
KeyUp $102 Scan code - -
KeyStroke $103 ASCII code - -
MouseDown $201 Mouse button (1 to 5) Gadget -
MouseUp $202 Mouse button (1 to 5) Gadget -
MouseMove $203 - Canvas Mouse position
MouseWheel $204 Turns - -
MouseEnter $205 - Canvas Mouse position
MouseLeave $206 - Canvas -
GadgetAction $401 New value Gadget -
WindowMove $801 - Window New position
WindowSize $802 - Window New size
WindowClose $803 - Window -
WindowActivate $804 - Window -
WindowScale $805 Scale in percent Window -
MenuEvent $1001 Menu number - -
AppSuspend $2001 - - -
AppResume $2002 - - -
AppBeginModal $2004 - - -
AppEndModal $2005 - - -
TimerTick $4001 Ticks so far Timer -

Examples

Graphics 320, 240, 32, 2
win  = CreateWindow("Keys", 20, 20, 260, 120, Desktop(), 3)
info = CreateLabel("Press a key", 10, 10, 230, 60, win)
Repeat
	e = WaitEvent()
	If e = $103 Then SetGadgetText info, "Typed " + Chr$(EventData()) + " = " + EventData()
Until e = $803

Media

EventData

Related Commands

EventID, EventSource, EventX, EventY, EventZ, PeekEvent, WaitEvent

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally