Send UI Button Event with key press NOT onClick()???

Hi,
I’ve got a simple start menu with “Start” and “quit” buttons. I’ve already set up navigation between them with Horizontal axis using the EventSystem, but I have no idea how to get either of my buttons to call a method in my ManagerScript using Enter or Space keys. I know how to do this using the “OnClick()” on the button component, but I would like to have no mouse, only keyboard inputs. There are plenty of games that use gamepad or keyboard to send events via UI, so I feel like it’s probably really simple. So how would I go about that tho?

Thanks!!!

In the Standalone Input Module component of the Event System game object in your scene, you can specify which keyboard/joystick inputs to use for Submit and Cancel on your UI. (You set these buttons up in Edit/ProjectSettings/Input)

Then on your button, add an Event Trigger for Submit

Use:

void Update () {
        if (Input.GetKeyDown("Enter"))
        {
                Application.Quit();
        }
}

This would be for the quit button. For the Start button replace Application.Quit(); with whatever variable or method you are using to start the game.