addUserActionEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *E([a-z])" to "$1 - e$2") |
||
Line 19: | Line 19: | ||
* "Analog" | * "Analog" | ||
|p3= expression: [[Code]] - | |p3= expression: [[Code]] - expression that will be executed in [[missionNamespace]] when event handler fires.<br> | ||
The Event Handler index is available as {{hl|_thisEventHandler}} during Event Handler code execution. | The Event Handler index is available as {{hl|_thisEventHandler}} during Event Handler code execution. | ||
{{Feature | important | ''expression'' can only be [[Code]], '''not''' [[String]].}} | {{Feature | important | ''expression'' can only be [[Code]], '''not''' [[String]].}} |
Revision as of 14:06, 8 November 2023
Description
- Description:
- Adds a user action event handler to the current mission and returns its event handler index.
- Groups:
- Event Handlers
Syntax
- Syntax:
- addUserActionEventHandler [keyName, event, expression]
- Parameters:
- keyName: String - action key name - see inputAction/actions
- event: String - event name - see UserAction Event Handlers. Can be one of:
- "Activate"
- "Deactivate"
- "Analog"
- expression: Code - expression that will be executed in missionNamespace when event handler fires.
The Event Handler index is available as _thisEventHandler during Event Handler code execution. - Return Value:
- Number - The index of the currently added UserAction event handler is returned
Examples
- Example 1:
- private _ehId = addUserActionEventHandler ["ReloadMagazine", "Activate", { systemChat "reloading!"; }];
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note