Page MenuHomeFeedback Tracker

_This select x called through displayAddEventHandler KeyDown/Up returns <null>
Closed, ResolvedPublic

Description

What I do :
_nul = [_this] execVM "EventHandler.sqf" >> Executes correctly

EventHandler.sqf
KeyDownFunction = {
hint format["_this : %1\n_this select 1 : %2",_this,_this select 1];
};
_KeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "[_this] call KeyDownFunction;"];

What I get :
Hint returns
_this : [Display #46,DikCode(46,32,whatever..),false,false,false]
_this select 1 : <null>

What I should get :
_this select 1 : DikCode(46,32,whatever..)

Tested on devbuild, still doing the same thing.
(I tried using CBA to execute the EH on a Man class, didn't work...)
{F21558} {F21559}

Details

Legacy ID
2919364164
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce

Just use the attached sqf file anywhere (Man, vehicle, init.sqf, etc...)

Alternatively, the code in the description should work too.

Event Timeline

KiTooN edited Steps To Reproduce. (Show Details)Aug 23 2013, 6:11 PM
KiTooN edited Additional Information. (Show Details)
KiTooN set Category to Scripting.
KiTooN set Reproducibility to Always.
KiTooN set Severity to None.
KiTooN set Resolution to Fixed.
KiTooN set Legacy ID to 2919364164.May 7 2016, 4:12 PM
KiTooN added a subscriber: KiTooN.

False alarm, I was too sloppy.

Solution :
Call the EH like this (_this not an array)
_KeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call KeyDownFunction;"];