mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-14 07:15:31 +02:00
Add process_mode property to PTY
Adds process_mode property to PTY which can be set to IDLE or PHYSICS. Determines whether the PTY will be updated in the `_process()` or `_physics_process()` step. Defaults to PHYSICS.
This commit is contained in:
parent
2acb93f8ff
commit
3378e6ff8f
7 changed files with 55 additions and 28 deletions
|
@ -4,7 +4,6 @@ extends "../../terminal.gd"
|
|||
signal exited(exit_code, signum)
|
||||
|
||||
var editor_settings: EditorSettings
|
||||
var timer := Timer.new()
|
||||
|
||||
onready var pty = $PTY
|
||||
|
||||
|
@ -51,20 +50,6 @@ func _ready():
|
|||
)
|
||||
_native_terminal._update_theme()
|
||||
|
||||
# In editor _process is not called continuously unless the "Update Continuously"
|
||||
# editor setting is enabled. This setting is disabled by default and uses 100%
|
||||
# of one core when enabled, so best to leave it off and use a timer instead.
|
||||
add_child(timer)
|
||||
timer.wait_time = 0.025
|
||||
timer.connect("timeout", self, "_poll")
|
||||
timer.start()
|
||||
|
||||
|
||||
func _poll():
|
||||
if pty and pty.has_method("get_master"):
|
||||
pty.get_master().poll()
|
||||
update()
|
||||
|
||||
|
||||
func _input(event):
|
||||
if has_focus() and event is InputEventKey and event.is_pressed():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue