displayAddEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <dd class="notedate">" to " <dt><dt> <dd class="notedate">")
m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "")
Line 39: Line 39:


<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on October 30, 2013 - 11:14</dd>
<dd class="notedate">Posted on October 30, 2013 - 11:14</dd>
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]<dd class="note">As of Arma 3 v1.06 [[ctrlAddEventHandler]] and [[displayAddEventHandler]] support script [[Code]] in addition to [[String]] [http://forums.bistudio.com/showthread.php?149636-Development-Branch-Changelog&p=2546439&viewfull=1#post2546439]
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]<dd class="note">As of Arma 3 v1.06 [[ctrlAddEventHandler]] and [[displayAddEventHandler]] support script [[Code]] in addition to [[String]] [http://forums.bistudio.com/showthread.php?149636-Development-Branch-Changelog&p=2546439&viewfull=1#post2546439]
Line 45: Line 44:
<dt class="note">[[User:Axyl|Axyl]]<dd class="note">From within an Addon, you must assign the events from a spawned script.  eg<code>[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this call my_KeyDownFunctionhandler"]; };</code>
<dt class="note">[[User:Axyl|Axyl]]<dd class="note">From within an Addon, you must assign the events from a spawned script.  eg<code>[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this call my_KeyDownFunctionhandler"]; };</code>


<!-- Note Section END -->
</dl>
</dl>



Revision as of 00:32, 6 April 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
GUI Control - Event HandlersEvent Handlers

Syntax

Syntax:
Syntax needed
Parameters:
display: Display
[eventName, code]: Array
eventName: String
code: String or Code
Return Value:
Return value needed

Examples

Example 1:
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", "hint str _this;"];
Example 2:
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", {hint str _this}];

Additional Information

See also:
ListOfKeyCodesdisableSerializationdisplayRemoveAllEventHandlersdisplayRemoveEventHandlerdisplaySetEventHandlerctrlAddEventHandlerUI Event HandlersfindDisplayDIK KeyCodeskeyName

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
Posted on October 30, 2013 - 11:14
Killzone_Kid
As of Arma 3 v1.06 ctrlAddEventHandler and displayAddEventHandler support script Code in addition to String [1]
Posted on March 10, 2014 - 14:52
Axyl
From within an Addon, you must assign the events from a spawned script. eg[] spawn { (findDisplay 46) displayAddEventHandler["KeyDown","_this call my_KeyDownFunctionhandler"]; };
Posted on January 22, 2016 - 08:15 (UTC)
Pigneedle
Be sure to wait until the main display is initialized before using this command by using: waituntil {!isnull (finddisplay 46)};
Posted on May 28, 2017 - 11:32 (UTC)
IT07
use #define if you want the displayEventHandler to use data that is defined in the same file in which the command is executed. However, that does not work if you use STRING as 'code'. In case of STRING, use the format command around it.
Posted on August 7, 2017 - 15:08 (UTC)
DrSova
Using KeyUp you can't override default engine action by returning true (A3 1.72.142342)