gc8 977 Posted March 23, 2020 Hi Is it possible to detect when player opens the supports menu? (0-8) I could check that with commandingMenu but then I'd need to check it like each frame. An event handler would be better.. thx! Share this post Link to post Share on other sites
opusfmspol 280 Posted March 25, 2020 Perhaps try: inGameUISetEventHandler Never used it though. You would need the 'engine based action name' for (8) in (0-8). Don't know whether it uses the action name, or Action names, or the CfgCommunicationMenu classname of the selection (or the class's text value), or what. inGameUISetEventHandler ["Action", "if (_this select 3 == << Support menu (8) >>) then {<< code >>; << code >>; << boolean >>}"]; Share this post Link to post Share on other sites
gc8 977 Posted March 26, 2020 @opusfmspol Tried that one already but didn't work. I think it's only for the scroll actions. thx :) Share this post Link to post Share on other sites
beno_83au 1369 Posted March 26, 2020 What about key pressed event handlers? 1 Share this post Link to post Share on other sites
gc8 977 Posted March 26, 2020 36 minutes ago, beno_83au said: What about key pressed event handlers? Not sure how to go about doing that but it might be one option Share this post Link to post Share on other sites
beno_83au 1369 Posted March 26, 2020 https://community.bistudio.com/wiki/displayAddEventHandler - the description has links for keyup/down events. Share this post Link to post Share on other sites
gc8 977 Posted March 26, 2020 6 minutes ago, beno_83au said: https://community.bistudio.com/wiki/displayAddEventHandler - the description has links for keyup/down events. yeah I know the EH just don't know how to write the code.... maybe check that last two keys are 0 & 8 but not sure if that's the best way Share this post Link to post Share on other sites
gc8 977 Posted March 26, 2020 Well I hacked in this code: #include "\a3\ui_f\hpp\definedikcodes.inc" waituntil { !isnull (findDisplay 46) }; findDisplay 46 displayAddEventHandler ["KeyDown", { params ["_display","_key"]; if(commandingMenu == "RscMenuReply") then { if(_key == DIK_8) then // About to open support menu { systemchat "Opening support menu..."; showCommandingMenu ""; // Deny opening (Close the whole menu) }; }; }]; You can also return true from the EH to ignore the key presses Share this post Link to post Share on other sites
beno_83au 1369 Posted March 26, 2020 12 minutes ago, gc8 said: You can also return true from the EH ignore the key presses Yep, good for a range of things. Share this post Link to post Share on other sites
Larrow 2820 Posted March 26, 2020 56 minutes ago, gc8 said: if(_key == DIK_8) What happens if the user has changed/not bound any keybindings for commandingMenu selection? I don't, 1-0 is unit selection, F1-F10 are 'Open Menu #', everything else I do by scroll and middle mouse. TAG_fnc_isNotSupportMenu = { if ( commandingMenu == "#User:BIS_fnc_addCommMenuItem_menu" ) then { hint "Closing Support Menu"; showCommandingMenu ""; false }else{ true }; }; findDisplay 46 displayAddEventHandler[ "KeyUp", { [] call TAG_fnc_isNotSupportMenu; }]; findDisplay 46 displayAddEventHandler[ "MouseButtonUp", { [] call TAG_fnc_isNotSupportMenu; }]; 2 Share this post Link to post Share on other sites
gc8 977 Posted March 26, 2020 6 minutes ago, Larrow said: What happens if the user has changed/not bound any keybindings for commandingMenu selection? Thx Larrow. I thought I probably forgot something :) Share this post Link to post Share on other sites