Just set the "Focus Mode" to "None" and do the input handling yourself via the
_unhandled_input-functions covered in greater detail here.
Here's a very simple example tree:
- GUI (Node-Type: Control)
- ButtonA (Node-Type: Button, Focus Mode = None)
- ButtonB (Node-Type: Button, Focus Mode = None)
Then your GUI.gd-script could look like this:
if event is InputEventKey and event.pressed:
func _on_ButtonA_pressed() -> void:
func _on_ButtonB_pressed() -> void:
When you now run the game, you can press the A-key to activate ButtonA and print "A", the B-key to activate ButtonB and print "B" or both at the same time.