Prevent loss of focus on Tab/Arrow key press

Prevents Terminal losing focus when in a scene with other inputs and
the Tab or Arrow keys are pressed.

Fixes #51.
This commit is contained in:
Leroy Hopson 2022-08-03 22:07:21 +12:00 committed by Leroy Hopson
parent 8a3adbbe68
commit d558b07fd4
3 changed files with 96 additions and 0 deletions

View file

@ -184,6 +184,10 @@ func _gui_input(event):
):
_native_terminal.sb_reset()
# Prevent focus changing to other inputs when pressing Tab or Arrow keys.
if event.scancode in [KEY_LEFT, KEY_UP, KEY_RIGHT, KEY_DOWN, KEY_TAB]:
accept_event()
_handle_mouse_wheel(event)
_handle_selection(event)