How can I disable opening the Main Menu at runtime?

I tried setting its toggle key to "none" via C#, but no dice. There are times in my game when I want to simply disable the ability for the player to open up the main menu.

Code:
private KeyCode MenuOpenKeyCode = KeyCode.None;
        public void SetMenuEnabled(bool isEnabled)
        {
            var mmInput = this.InventoryStandardInput.m_OpenTogglePanelInput.First(opi => opi.PanelName == "Main Menu");


            if( this.MenuOpenKeyCode == KeyCode.None)
            {
                // store the initial keycode
                this.MenuOpenKeyCode = mmInput.Input.m_KeyCode;
            }


            if (isEnabled)
            {
                // use initial keycode
                mmInput.Input.m_KeyCode = this.MenuOpenKeyCode;
            } else
            {
                // NO keycode -- prevent from opening
                mmInput.Input.m_KeyCode = KeyCode.None;
            }
        }
 
Opening and closing the main menu is handled by the "Display Panel Manager Handler" (Normally it should be on your Inventory Canvas). So you should be able to disable opening the main menu simply by disabling that component such that it's update function is not called.

There is also the option to replace that "Display Panel Manager Handler" component by a custom script such that you can have more control over how you open/close your menus
 
Can you confirm you are using the latest version v1.1.7?

It's an optional component, but normally it's the only component that disables the menu on a button press since I removed the InventoryInput component and replaced it by the Opsive Shared input system.

Try adding a Debug.Log in the CloseSelectedPanel function of the DisplayPanelManager component, to know what is calling the close menu
 
Top