From ec49a38fa339e1d192b4ac107c63b0e6eb721ebb Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 30 Nov 2015 15:00:05 +0100 Subject: [PATCH] add keyhandlers to zeus interface --- addons/events/XEH_preClientInit.sqf | 7 +++++++ addons/keybinding/gui/gui.hpp | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/addons/events/XEH_preClientInit.sqf b/addons/events/XEH_preClientInit.sqf index ebc6b9871..164b60530 100644 --- a/addons/events/XEH_preClientInit.sqf +++ b/addons/events/XEH_preClientInit.sqf @@ -66,6 +66,13 @@ FUNC(attach_handler) = { ["KeyUp", QUOTE(UP call FUNC(keyHandler))] call (uiNamespace getVariable "CBA_fnc_addDisplayHandler"); ["KeyDown", QUOTE(DOWN call FUNC(keyHandler))] call (uiNamespace getVariable "CBA_fnc_addDisplayHandler"); +// add keyhandlers to zeus interface +["CBA_curatorOpened", { + params ["_display"]; + _display displayAddEventHandler ["KeyUp", {UP call FUNC(keyHandler)}]; + _display displayAddEventHandler ["KeyDown", {DOWN call FUNC(keyHandler)}]; +}] call CBA_fnc_addEventHandler; + SLX_XEH_STR spawn { waitUntil { !isNull (findDisplay 46) }; // Workaround for Single Player, mission editor, or mission, preview/continue, whatever, adding double handlers diff --git a/addons/keybinding/gui/gui.hpp b/addons/keybinding/gui/gui.hpp index e9005f850..c9e155754 100644 --- a/addons/keybinding/gui/gui.hpp +++ b/addons/keybinding/gui/gui.hpp @@ -174,3 +174,8 @@ class RscDisplayConfigure { }; }; }; + +class RscDisplayCurator { + onLoad = "['CBA_curatorOpened', _this] call CBA_fnc_localEvent; [""onLoad"",_this,""RscDisplayCurator"",'CuratorDisplays'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; + onUnload = "['CBA_curatorClosed', _this] call CBA_fnc_localEvent; [""onUnload"",_this,""RscDisplayCurator"",'CuratorDisplays'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; +};