Skip to content

Commit

Permalink
Handle escape menu with toggle iteractMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed May 10, 2017
1 parent f1ee775 commit 6cef25b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion addons/interact_menu/functions/fnc_keyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6cef25b

Please sign in to comment.