mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 20:24:23 +02:00
feat(term): implement data_sent signal
This commit is contained in:
parent
14288352fd
commit
988788fc68
2 changed files with 18 additions and 0 deletions
|
@ -25,6 +25,7 @@ using namespace godot;
|
|||
|
||||
void Terminal::_bind_methods()
|
||||
{
|
||||
ADD_SIGNAL(MethodInfo("data_sent", PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data")));
|
||||
ADD_SIGNAL(MethodInfo("key_pressed", PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data"), PropertyInfo(Variant::OBJECT, "event")));
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_cols"), &Terminal::get_cols);
|
||||
|
@ -229,6 +230,8 @@ void Terminal::_write_cb(tsm_vte *vte, const char *u8, size_t len, void *data)
|
|||
term->emit_signal("key_pressed", data.get_string_from_utf8(), term->last_input_event_key);
|
||||
term->last_input_event_key.unref();
|
||||
}
|
||||
|
||||
term->emit_signal("data_sent", data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue