ShadowRanger24 50 Posted March 22, 2017 So I'm trying to make it possible to close the EG Spectator Mode with having it initialized via a script (not the debug console in the escape menu). Currently the main way of closing it is just to click the 'Spectator' button in the debug console. But if your mission has the debug console disabled and you're initializing the spectator menu via a script, how are you meant to close it? I know that you can use '["Terminate"] call BIS_fnc_EGSpectator' but how can you call this through a key press if KeyPressed does not run while a player is in the spectator menu? Thanks in advance. 1 Share this post Link to post Share on other sites
ShadowRanger24 50 Posted March 22, 2017 Nevermind guys, figured out a few ways to do it. I just needed to add a KeyDown event handler to the EG spectator dialog for it to detect key presses. Thanks anyways. 1 Share this post Link to post Share on other sites
thegamerscat 10 Posted May 3, 2017 On 3/22/2017 at 7:44 PM, ShadowRanger24 said: Nevermind guys, figured out a few ways to do it. I just needed to add a KeyDown event handler to the EG spectator dialog for it to detect key presses. Thanks anyways. Hey, I'm trying to do this too, could you share how you did it? I cant seem to get it working Share this post Link to post Share on other sites
ShadowRanger24 50 Posted May 4, 2017 20 hours ago, thegamerscat said: Hey, I'm trying to do this too, could you share how you did it? I cant seem to get it working DS_egKeyDown = (findDisplay 60492) displayAddEventHandler ["KeyDown", { _handled = false; switch (_this select 1) do { case 68: { (findDisplay 60492) displayRemoveEventHandler ["KeyDown", DS_egKeyDown]; ["Terminate"] call BIS_fnc_EGSpectator; _handled = true; }; _handled }]; Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 Or just find the display in which the spectator menu is set on and use closeDisplay Share this post Link to post Share on other sites