diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 58286a65bb8..8bb263808ce 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -59,7 +59,16 @@ if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); }; (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", { + // Handle the escape key being pressed with menu open: + if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers + GVAR(actionSelected) = false; + systemChat "wow"; + [GVAR(openedMenuType), false] call FUNC(keyUp); + false // continue to pass the escape + }; + [_this,'keydown'] call CBA_events_fnc_keyHandler; + }]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened);