LineEdit release focus on Enter key pressed

This commit is contained in:
Marco 2020-03-13 19:51:39 +01:00
parent 096a81d61c
commit 54ed08357d
2 changed files with 9 additions and 1 deletions

View file

@ -189,6 +189,11 @@ func _input(event : InputEvent) -> void:
Global.left_cursor.texture = Global.left_cursor_tool_texture
Global.right_cursor.position = get_global_mouse_position() + Vector2(32, 32)
Global.right_cursor.texture = Global.right_cursor_tool_texture
if event is InputEventKey && (event.scancode == KEY_ENTER || event.scancode == KEY_KP_ENTER):
if get_focus_owner() is LineEdit:
get_focus_owner().release_focus()
if event.is_action_pressed("toggle_fullscreen"):
OS.window_fullscreen = !OS.window_fullscreen