BRL.Event: Types Globals Functions Source  


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 global event queue

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


Types

TEventEvent object type

Globals

EmitEventHookHook id for emitted events

Functions

EmitEventEmit an event
CreateEventCreate an event object
AllocUserEventIdAllocate a user event id

Global reference

Global EmitEventHook=AllocHookId()
DescriptionHook id for emitted events
Information The 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.

Function reference

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

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 AllocUserEventId( description$="" )
ReturnsA new user event id
DescriptionAllocate a user event id