mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
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:
parent
8a3adbbe68
commit
d558b07fd4
3 changed files with 96 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue