Using Keyboard/Gamepad for Menu

So when I click a button on my menu in game, I can move between the rest of the buttons with the keyboard and the gamepad and select them just fine. I have to use the mouse first though, how do I get it to use the keyboard or gamepad from the start?