Settings for menu control

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Davidek383
:warning: Old Version Published before Godot 3 was released.

Hi, I am messing with menu in my game and cant figure out how to select buttons with pressing keys. I have a ButtonGroup and buttons in it. I found that buttons have in params Focus Neighbour so I set it up but it doesnt work… I expect that I have forgotten smt and its really noob problem so please help me out…

:bust_in_silhouette: Reply From: avencherus

If you’re looking to send focus to a control. Control objects have a method called .grab_focus()

Docs: Control — Godot Engine (stable) documentation in English

Assuming you have a Control node with a Button node named Button as it’s child:
With something like this, you can send focus by hitting any keyboard key.

extends Control

func _ready():
func _input(event):
	if(event.type == InputEvent.KEY):
:bust_in_silhouette: Reply From: atze

To use the focus neighours you have to focus on it’s neighbours in a script.

    func _ready():