Blitz3D+ Command Reference

EventData ( )

Parameters

None.

Description

Returns the data value of the current event - what it means depends on the event id.

EventData is the payload slot of the event the last WaitEvent or PeekEvent fetched. By event family it carries:

$101/$102 key down/up: the keyboard scan code
$103 key character: the typed character (a Unicode value for Chr)
$201/$202 mouse down/up: the button - 1 left, 2 right, 3 middle
$204 mouse wheel: the wheel movement in detents (negative for the other way)
$401 gadget action: a control-specific value - the selected index for combo boxes, list boxes and tabbers, the new value for spin boxes and trackbars, the raw key for hotkey fields, 1 for text edits
$403 gadget drop: the dragged tree node handle; EventZ holds the destination node handle
$1001 menu action: the menu_id tag you gave CreateMenu
$2003 display change: the new bits per pixel
$4001 timer tick: the cumulative tick count

Everything else leaves it at 0.

One gotcha: on a multi-select list box (style 1), a $401's EventData is only the focused selected item, or -1 - the event is a replaceable snapshot, not the full story. Enumerate the list with CountSelectedGadgetItems and NextSelectedGadgetItem instead.

Events you post yourself with HotKeyEvent carry whatever ev_data you registered.

See it working in the menus and events sample and the world editor shell sample.

Requires Extended mode.

See also: EventID, EventSource, EventX, EventY, WaitEvent.

Index