GUI buttons with alternate activation condition

I have some gui buttons for a menu but id like them to be able to be hot keyed essentially but for the gamepad.

Ive tried successfully:

if (GUI.Button(new Rect(10, 70, 50, 30), "Click") || Input.GetKeyDown(KeyCode.Space))
    //Some Code

But this does not work:

if (GUI.Button(new Rect(10, 70, 50, 30), "Click") || Input.GetKeyDown(KeyCode.JoystickButton0))
    //Some Code

Clicking the button is working normally but the right side isn’t evaluating to True. Is there some reason behind the scenes to cause this? And yep the gamepad does work, have lots of other code using KeyCode.JoystickButtonX

Edit: Found Issue: Joystick input is not recognised inside OnGUI function.

No reason whatsoever. This is just a simple OR statement, there’s no reason it wouldn’t work, regardless of what the right-part of the if statement includes.

Just for the sake of debugging, try the following code instead:

bool clicked = GUI.Button(new Rect(10, 70, 50, 30), "Click"));
bool joystick = Input.GetKeyDown(KeyCode.JoystickButton0);
Debug.Log("clicked: " + clicked + ", joystick: " + joystick);
if (clicked || joystick) {
    Debug.Log("Inside if statement");
    // rest of code

And see what the log prints.