extends Node
func _ready() -> void:
# 为所有按钮连接 pressed 信号,使点击时也获取焦点
for child in get_children():
if child is Button:
child.pressed.connect(_on_button_pressed.bind(child))
func _on_button_pressed(button: Button) -> void:
button.grab_focus()
extends Node
func _ready() -> void:
# 为所有按钮连接 pressed 信号,使点击时也获取焦点
for child in get_children():
if child is Button:
child.pressed.connect(_on_button_pressed.bind(child))
func _on_button_pressed(button: Button) -> void:
button.grab_focus()