Рефактор
This commit is contained in:
15
scripts/astra-kb.gd
Normal file
15
scripts/astra-kb.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Node
|
||||
|
||||
var pid = null
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
signaller.connect('kb_pressed', Callable(self, 'on_kb_pressed'))
|
||||
|
||||
|
||||
func on_kb_pressed(state):
|
||||
if pid:
|
||||
OS.kill(pid)
|
||||
pid = null
|
||||
if state:
|
||||
pid = OS.create_process('fly-vkbd', [])
|
||||
Reference in New Issue
Block a user