mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
33ef60266b
commit
5b8708a179
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user