Page MenuHomeFeedback Tracker

[BUG] displayAddEventHandler [KeyDown?] remains available after mission restart
New, NormalPublic

Description

As per Arma discord discussion this might not be intentional/desirable behavior.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

0. Load and start any SP mission (with a way to have console available) or scenario/temporary mission in Eden

  1. Execute from console:
(findDisplay 46) displayAddEventHandler ["KeyDown", 
{ 
 params ["_display","_key","_shift","_ctrl","_alt"]; 
 
 _return = false; 
 
 switch (_key) do 
 { 
  case (0xC7): 
  { 
   if (_ctrl) then 
   { 
    [] spawn 
    { 
     systemchat str diag_tickTime; 
 
     _return = true; 
    }; 
   }; 
  }; 
 }; 
 
 _return 
}];
  1. Hit CTRL+HOME
  2. Notice the chat output
  3. ESC Menu
  4. Restart the mission
  5. Notice CTRL+HOME still producing the output
Additional Information

The addEH is not stored in savegames it seems.

Event Timeline

This comment was removed by Tenshi.
Tenshi added a subscriber: Tenshi.Mar 7 2022, 11:13 AM
dedmen added a subscriber: dedmen.Mar 14 2022, 4:41 PM

If the mission display is not closed, then the eventhandler staying is indeed intentional.
Usually it does close between missions though, but "restart" specifically might indeed not.