From 8839718bf7b7a5c75984590360b626732f62ab9b Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Tue, 15 Sep 2026 14:38:48 +0800 Subject: [PATCH] fix(zaparoo): keep bridged keys held while the frontend is active uinp_check_key() only keeps a bridged key down, and repeats it, while input is not grabbed. Otherwise it releases the key on the next input pass. Since frontend scanout ownership, video_fb_set() returns before input_switch(0), so grabbed stays set while the frontend owns the screen and every key bridged to it becomes a tap. Holding a direction on a controller, keyboard or the Zaparoo App Controls pad never starts the frontend's hold-repeat. Treat an active frontend like released input in uinp_check_key(). With the OSD open, and whenever the frontend is not running, the grabbed branch still releases held keys as before. The grab itself is not changed, so mouse and joystick handling that reads grabbed is unaffected. --- ZAPAROO_FORK.md | 2 +- input.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZAPAROO_FORK.md b/ZAPAROO_FORK.md index 085aad4b3..85d9d27e5 100644 --- a/ZAPAROO_FORK.md +++ b/ZAPAROO_FORK.md @@ -30,7 +30,7 @@ non-blocking spawn) are intentionally omitted. | 4 | **Forced cfg override** | `alt_launcher_cfg_apply()` forces only `cfg.fb_terminal = 1` after INI parse because the frontend requires direct framebuffer access. `RECENTS` and `LOG_FILE_ENTRY` remain user-controlled. Original `ALT_LAUNCHER` / `MENU_RBF` INI knobs were dropped in favor of file-existence detection | `cfg.cpp:628`, `support/zaparoo/alt_launcher.cpp` (`alt_launcher_cfg_apply`) | | 5 | **Polling integration** | `alt_launcher_poll()` driven by main scheduler tick | `scheduler.cpp:36`, `support/zaparoo/alt_launcher.cpp:365` | | 6 | **TTY / framebuffer hygiene** | Clear/reset tty2 around frontend lifecycle; toggle `video_fb_enable` and `video_chvt` only on respawn paths; don't touch them on plain shutdown | `support/zaparoo/alt_launcher.cpp` (`clear_launcher_tty`, `reset_launcher_tty`) | -| 7 | **Joypad routing into frontend** | `alt_launcher_fb_terminal_key()` translates `JOY_L2/R2/OSD` to `KEY_F1/BACKSPACE/MENU`; `joy_digital()` short-circuits to `uinp_send_key` when frontend active | `input.cpp:2475-2484`, `support/zaparoo/alt_launcher.cpp:45-62` | +| 7 | **Joypad routing into frontend** | `alt_launcher_fb_terminal_key()` translates `JOY_L2/R2/OSD` to `KEY_F1/BACKSPACE/MENU`; `joy_digital()` short-circuits to `uinp_send_key` when frontend active. `uinp_check_key()` keeps bridged keys held while the frontend is active even though `grabbed` is still set: frontend scanout ownership (row 44) skips the `input_switch(0)` in `video_fb_set()`, and the grabbed branch otherwise releases every bridged key on the next input pass, turning holds into taps | `input.cpp:2475-2484`, `input.cpp` (`uinp_check_key`, 1-line fork edit), `support/zaparoo/alt_launcher.cpp:45-62` | | 8 | **Native CRT rendering path** | Frontend running in CRT mode: kernel framebuffer at 320×240 RGBA8888, FPGA scans separate region at `0x3A000000`; pre-spawn blank wipes the prior frame. (The v2 contract dropped the old `status[9]` gate: nothing in `support/zaparoo/` writes it) | `support/zaparoo/alt_launcher.cpp` (`enable_native_crt_path`, `disable_native_crt_path`, `blank_native_crt_fb`); paired with `Menu_MiSTer/rtl/native_video_*.sv` | | 9 | **CRT mode persistence** | 2-byte `zaparoo_launcher_crt.bin` (byte 0 enabled, byte 1 video standard 0 NTSC / 1 480i / 2 PAL) via `FileSaveConfig` / `FileLoadConfig`; loaded at menu init, applied on spawn; the frontend writes the same file and exits 42 to be respawned | `support/zaparoo/alt_launcher.cpp` (`load_persisted_native_crt_state`, `alt_launcher_toggle_native_crt`, `alt_launcher_set_native_crt_mode`) | | 10 | **Native-core auto-init** | `zaparoo_is_native_core()` matches core name `"Zaparoo Launcher"`; `zaparoo_alt_launcher_init_for_core()` auto-spawns when the FPGA loads that core | `support/zaparoo/alt_launcher.cpp:480-495`, `user_io.cpp:1543` | diff --git a/input.cpp b/input.cpp index 2f4a9d539..72bcf50be 100644 --- a/input.cpp +++ b/input.cpp @@ -2112,7 +2112,7 @@ static void uinp_check_key() { if (uinp_fd > 0) { - if (!grabbed && !user_io_osd_is_visible()) + if ((!grabbed || alt_launcher_active()) && !user_io_osd_is_visible()) { if (uinp_ev.value && CheckTimer(uinp_repeat)) {