How do you make a Main Menu that only takes Joystick input and is not affected by the Cursor

I have setup a main menu using the Canvas UI, buttons and text based upon the Unity 5 tutorials: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

In the EventSystem I have set First Selected to the Play Button that I created. When the Menu begins the Play Button is selected allowing the player to navigate through the other buttons on the menu via the left stick on an Xbox controller. The problem is that if the player clicks on the game window using the mouse, but not on a button, then it makes the button currently highlighted no longer highlighted thus making navigation on the menu impossible with a controller.

I have tried hiding the cursor and locking it to the center but that does not prevent the mouse click from deselecting the button currently highlighted.

Is there a way to prevent the cursor from interfering with the joystick input or at least allow a button to stay highlighted despite clicking in the game window and not on a button?

not sure if what youre trying to do is actually possible. generally, when i make a nonstandard interface, i dont use the GUI objects, i use regular GameObjects then code in everything myself for selection and hoveranimations.

A current solution I have is the following:

  • Hide the cursor using Cursor.visible = false;

  • Create a completely transparent Panel in front of the canvas used to prevent the cursor with interfering with the buttons

  • Reload the scene if there is any mouse input:

     if (Input.GetMouseButtonDown(0))
     {
     	Application.LoadLevel(Application.loadedLevel);
     }
     
     if (Input.GetMouseButtonDown(1))
     {
     	Application.LoadLevel(Application.loadedLevel);
     }
     
     if (Input.GetMouseButtonDown(2))
     {
     	Application.LoadLevel(Application.loadedLevel);
     }
    

I’m still open to suggestions but for now this will suffice.