Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.45

Description

Description:Adds a global event handler (see VBS Global Event Handlers).

Multiple event handlers of the same type can be added - they are differentiated by their unique index, and fire simultaneously.

Every event creates an array named _this, which contains specific information about the particular event, and which can be used in the code element of the command.

Syntax

Syntax:addGlobalEventHandler [type,code]
Parameters:
  • type: String - Event handler type (see VBS Global Event Handlers for options).
  • code: String - Code to execute, once the event occurs. The code receives the event data in the _this variable, depending on the event type.
Return Value:Number - Event handler index,

Examples

Examples:
addGlobalEventHandler ["CameraOnChanged",{hint str _this}]

Additional Information

See also: Category VBS Event Handlers, removeGlobalEventHandler, removeAllGlobalEventHandlers, addEventHandler
Multiplayer: 
Problems: 

Notes