BRL.Event: Globals Functions Types Modinfo Source  

Event objects

Event objects are used to notify your application about external events such as user input, user interface activity and so on.

The are two main ways your program can receive events: either by adding a hook function to the EmitEventHook hook, or by using using the EventQueue.

The most important field in an event object is the id field, which identifies the kind of event:
Event idDescription
EVENT_APPSUSPENDApplication suspended
EVENT_APPRESUMEApplication resumed
EVENT_APPTERMINATEApplication wants to terminate
EVENT_KEYDOWNKey pressed. Event data contains keycode
EVENT_KEYUPKey released. Event data contains keycode
EVENT_KEYCHARKey character. Event data contains unicode value
EVENT_MOUSEDOWNMouse button pressed. Event data contains mouse button code
EVENT_MOUSEUPMouse button released. Event data contains mouse button code
EVENT_MOUSEMOVEMouse moved. Event x and y contain mouse coordinates
EVENT_MOUSEWHEELMouse wheel spun. Event data contains delta clicks
EVENT_MOUSEENTERMouse entered gadget area
EVENT_MOUSELEAVEMouse left gadget area
EVENT_TIMERTICKTimer ticked. Event source contains timer object
EVENT_HOTKEYHITHot key hit. Event data and mods contains hotkey keycode and modifier
EVENT_MENUACTIONMenu has been selected.
EVENT_WINDOWMOVEWindow has been moved
EVENT_WINDOWSIZEWindow has been resized
EVENT_WINDOWCLOSEWindow close icon clicked
EVENT_WINDOWACTIVATEWindow activated
EVENT_WINDOWACCEPTDrag and Drop operation was attempted
EVENT_GADGETACTIONGadget state has been updated.
EVENT_GADGETPAINTA Canvas Gadget needs to be redrawn
EVENT_GADGETSELECTA TreeView Node has been selected.
EVENT_GADGETMENUUser has right clicked a TreeView Node or TextArea gadget.
EVENT_GADGETOPENA TreeView Node has been expanded.
EVENT_GADGETCLOSEA TreeView Node has been collapsed.
EVENT_GADGETDONEAn HTMLView has completed loading a page.

Globals

Global EmitEventHook
DescriptionHook id for emitted events.
InformationThe EmitEventHook global variable contains a hook id for use with AddHook.

Each time EmitEvent is called, the event is passed to all EmitEventHook hook functions by means of the hook function data parameter.

Functions

Function CreateEvent:TEvent( id,source:Object=Null,data=0,mods=0,x=0,y=0,extra:Object=Null )
ReturnsA new event object.
DescriptionCreate an event object.

Function EmitEvent( event:TEvent )
DescriptionEmit an event.
InformationRuns all EmitEventHook hooks, passing event as the hook data.

Types

Type TEvent
DescriptionEvent object type.
Field data
DescriptionEvent specific data.
Field extra:Object
DescriptionEvent specific extra information.
Field id
DescriptionEvent identifier.
Field mods
DescriptionEvent specific modifiers.
Field source:Object
DescriptionEvent source object.
Field x
DescriptionEvent specific position data.
Field y
DescriptionEvent specific position data.
Method Emit()
DescriptionEmit this event.
InformationThis method runs all EmitEventHook hook function, passing Self as the hook data.
Method ToString$()
DescriptionConvert event to a string.
InformationThis method is mainly useful for debugging purposes.
Function Create:TEvent( id,source:Object=Null,data=0,mods=0,x=0,y=0,extra:Object=Null )
ReturnsA new event object.
DescriptionCreate an event object.

Module Information

Version1.00
AuthorMark Sibly
LicenseBlitz Shared Source Code
CopyrightBlitz Research Ltd
ModserverBRL