Disable buttons from being selected with keyboard in UI?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zachThePerson

I have a column based UI, where you select an option in the first column, and then the second column opens up to reveal more options.

What I found, is that even when the first column of buttons is disabled, I can still use the arrow keys to “hover,” over them. Is there any way to disable this?

:bust_in_silhouette: Reply From: njamster

Select your button, then navigate to Control > Focus in the Inspector and set “Mode” to “None”. You can also set this property from code using:

get_node("Button").focus_mode = FOCUS_NONE

make sure to set focus_mode and not focus_mode_enabled as the latter is deprecated and doesn’t actually work properly

jpate | 2021-09-08 16:27