Arma 3 Scripting

Command in GUI Control - Event Handlers, Event Handlers

ctrlSetEventHandler

Also available as Markdown and JSON, or read the original wiki page.

Warning

This command is deprecated. Use ctrlAddEventHandler instead.

Description

Caution

This information is obsolete. Use ctrlAddEventHandler instead as it can stack event handlers.

Sets given event handler of given control: any previously added event handler is removed.

Note

Important

When using the event names listed here with the ctrlAddEventHandler, ctrlSetEventHandler, displayAddEventHandler or displaySetEventHandler commands, the prefix "on" in the event name must be removed (e.g. 'ButtonDown' instead of 'onButtonDown').

Syntax

controlName ctrlSetEventHandler [handlerName, function]

Parameters:

Returns: Nothing

Examples

Example 1

_control ctrlSetEventHandler ["KeyDown", ""];

Example 2

(_display displayCtrl 108) ctrlSetEventHandler ["LBSelChanged","['ListChange',_this] call FireEvents"];

See also

displaySetEventHandler · ctrlAddEventHandler · ctrlRemoveEventHandler · User Interface Event Handlers · DIK KeyCodes

Community notes