To connect a signal to a function, use the connect method:
connect
my_object.my_signal.connect(on_my_signal) func on_my_signal(): print("Signal received!")
To emit a signal, you can use the emit_signal method:
emit_signal
emit_signal("my_signal")
However, it's better to ditch those strings, by simply calling emit method inside the signal directly:
my_signal.emit()
To define a signal, use the signal keyword followed by the signal name:
signal
signal my_signal