Merge pull request #2216 from acemod/isolateZeusMenuKeybind

Prevent CBA keybindings in zeus interface
This commit is contained in:
SilentSpike 2015-08-31 14:41:48 +01:00
commit 5e57cad669

View File

@ -75,10 +75,32 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
}] call EFUNC(common,addEventHandler);
// Let key work with zeus open (not perfect, enables all added hotkeys in zeus interface rather than only menu)
// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings)
["zeusDisplayChanged",{
if (_this select 1) then {
(finddisplay 312) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}];
(finddisplay 312) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}];
(finddisplay 312) displayAddEventHandler ["KeyUp", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keyup'] call CBA_events_fnc_keyHandler
};
};
}];
(finddisplay 312) displayAddEventHandler ["KeyDown", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keydown'] call CBA_events_fnc_keyHandler
};
};
}];
};
}] call EFUNC(common,addEventHandler);