[FL-1491] Gui: input injection in screen stream (#573)

* Gui: input injection in screen stream
* Cli: expose ASCII table in public header
This commit is contained in:
あく
2021-07-09 05:16:54 +03:00
committed by GitHub
parent fe3bedbd3c
commit c3fda0c8c3
3 changed files with 32 additions and 15 deletions

View File

@@ -262,7 +262,24 @@ void gui_cli_screen_stream(Cli* cli, string_t args, void* context) {
gui_set_framebuffer_callback_context(gui, gui);
gui_set_framebuffer_callback(gui, gui_cli_screen_stream_callback);
gui_redraw(gui);
cli_getc(gui->cli);
// Wait for control events
while(true) {
char c = cli_getc(gui->cli);
if(c == CliSymbolAsciiEsc) {
c = cli_getc(gui->cli);
if(c == 'i') {
InputEvent input_event;
input_event.key = cli_getc(gui->cli);
input_event.type = cli_getc(gui->cli);
osMessageQueuePut(gui->input_queue, &input_event, 0, osWaitForever);
osThreadFlagsSet(gui->thread, GUI_THREAD_FLAG_INPUT);
}
} else {
break;
}
}
gui_set_framebuffer_callback(gui, NULL);
gui_set_framebuffer_callback_context(gui, NULL);
}