Prevent CBA keybindings in zeus interface

Checks if the key pressed matches the zeus menu keybind and only fires the code to handle CBA keybinds if true. Should fix the majority of weirdness with keybinds in zeus. However, not perfect as shared keybinds with different modifiers will still fire and it's really an un-ideal workaround.
This commit is contained in:
SilentSpike 2015-08-20 18:17:37 +01:00
parent 33ef60266b
commit 5b8708a179

View File

@ -75,10 +75,24 @@ 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) select 0;
if ((_this select 1) == _key) 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) select 0;
if ((_this select 1) == _key) then {
[_this,'keydown'] call CBA_events_fnc_keyHandler
};
}];
};
}] call EFUNC(common,addEventHandler);