submit form when enter is pressed

This commit is contained in:
Chris Cromer 2022-08-25 10:11:46 -04:00
parent 563cdade00
commit bb0c4e302d
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
2 changed files with 10 additions and 3 deletions

View File

@ -114,6 +114,10 @@ func show_error_message(message: String) -> void:
func _on_PopupDialog_gui_input(event: InputEvent) -> void:
if event.is_pressed():
var popup = get_node("%PopupDialog")
popup.hide()
var popup = get_node("%PopupDialog")
if popup.visible and event.is_pressed():
popup.call_deferred("hide")
func _on_text_entered(_new_text: String) -> void:
call_deferred("_on_Button_pressed")

View File

@ -237,9 +237,12 @@ valign = 1
autowrap = true
[connection signal="focus_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Name" to="GUI/Sounds" method="_play_ui_select_sound"]
[connection signal="text_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Name" to="GUI/VBoxContainer/CenterContainer3/Button" method="_on_text_entered"]
[connection signal="focus_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Rut" to="GUI/Sounds" method="_play_ui_select_sound"]
[connection signal="text_changed" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Rut" to="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Rut" method="_on_Rut_text_changed"]
[connection signal="text_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Rut" to="GUI/VBoxContainer/CenterContainer3/Button" method="_on_text_entered"]
[connection signal="focus_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Email" to="GUI/Sounds" method="_play_ui_select_sound"]
[connection signal="text_entered" from="GUI/VBoxContainer/CenterContainer2/VBoxContainer2/Email" to="GUI/VBoxContainer/CenterContainer3/Button" method="_on_text_entered"]
[connection signal="focus_entered" from="GUI/VBoxContainer/CenterContainer3/Button" to="GUI/Sounds" method="_play_ui_select_sound"]
[connection signal="pressed" from="GUI/VBoxContainer/CenterContainer3/Button" to="GUI/VBoxContainer/CenterContainer3/Button" method="_on_Button_pressed"]
[connection signal="focus_entered" from="PopupDialog" to="GUI/Sounds" method="_play_popup_sound"]