public static bool SButton(Rect area, GUIContent c, float padding = defaultPadding, string selectControl = "Jump") { string name = CreateNextControl(area); // NOTE: If Unity ever fixes the issue with Space bar pressing currently selected button, REMOVE THE INVERTED INPUT.GETKEY HERE! This is a crappy hacky workaround that only works 95% of the time, and disables clicking while space is held! bool ret = (Button(area, c, padding) && !Input.GetKey(KeyCode.Space)) || (InputWrapper.GUIGetButtonDown(selectControl) && GUI.GetNameOfFocusedControl() == name); //if (ret) { FocusLastControl(); } return(ret); }