displaySetEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Command " to "{{RV|type=command ")
m (Text replacement - "<dd class="notedate">Posted on ([^<>]+) " to "<dd class="notedate">Posted on $1</dd> ")
Line 56: Line 56:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on Nov 25, 2009
<dd class="notedate">Posted on Nov 25, 2009</dd>
<dt class="note">[[User:WGL.Q|kju]]
<dt class="note">[[User:WGL.Q|kju]]
<dd class="note">Always use [[displayAddEventHandler]] instead, as DSetEH '''overwrites''' other (peoples') DEH.
<dd class="note">Always use [[displayAddEventHandler]] instead, as DSetEH '''overwrites''' other (peoples') DEH.

Revision as of 02:08, 30 January 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
[handlerName, function]: Array
handlerName: String
function: String. {Code}
Return Value:
Return value needed

Examples

Example 1:
_control displaySetEventHandler ["KeyDown", ""] 
Example 2:
init.sqf

keyspressed = compile preprocessFile "keyspressed.sqf"; _display = findDisplay 46; _display displaySetEventHandler ["KeyDown","_this call keyspressed"];

keyspressed.sqf
private['_handled'];
_handled = false;
switch (_this select 1) do
{
	//F key
	case 33: 
	{
		// code here
		_handled = true;
	};
};
_handled;

Additional Information

See also:
See also needed

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 Nov 25, 2009
kju
Always use displayAddEventHandler instead, as DSetEH overwrites other (peoples') DEH.