feat(sim): web viewer at /sim + touch injection at /api/sim/touch

- GET /sim: live viewer page, 2s screenshot refresh, click-to-touch
- POST /api/sim/touch?x,y,down: injects into sdl-pointer backend,
  auto-releases after 1.5s; simulator-only (404 on ESP32)
- sdl_input: file-scope touch override state with extern C setters
This commit is contained in:
Adolfo Reyna
2026-09-14 21:02:54 -04:00
parent 620d56e19a
commit 2060095028
4 changed files with 144 additions and 1 deletions
@@ -42,6 +42,16 @@ bool sdl_input_pop_key(uint32_t* out_key);
*/
bool sdl_input_has_queued_key(void);
/**
* @brief Web-injected touch override (for headless sim viewer without SDL window).
* When active, sdl_pointer_get_touched_points() reports this state instead of
* the SDL mouse state. Coordinates are in LVGL logical pixels (e.g. 640x480).
* Pass pressed=false to release. Auto-releases after SIM_TOUCH_HOLD_MS unless
* refreshed (tap = press, wait, release handled by the web viewer).
*/
void sdl_input_set_touch_override(int32_t x, int32_t y, bool pressed);
void sdl_input_clear_touch_override(void);
#ifdef __cplusplus
}
#endif