Add SDL2-native C tools menu app for R36S - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce3a62f60e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| int len = (int)strlen(input_value); | ||
| if (b == BTN_LEFT && input_cursor > 0) input_cursor--; | ||
| if (b == BTN_RIGHT && input_cursor < len - 1) input_cursor++; |
There was a problem hiding this comment.
Support multi-digit entry in channel prompt
Numeric editing is fixed-length (len = strlen(input_value) with cursor bounded to len - 1), and the channel prompt initializes to a single character ("6"), so users can only cycle one digit (0–9). This makes it impossible to set common multi-digit channels like 36/44/149, which is a functional regression from the prior tools menu behavior.
Useful? React with 👍 / 👎.
| if (e.type == SDL_QUIT) running = false; | ||
| if (e.type == SDL_KEYDOWN) { | ||
| SDL_Keycode k = e.key.keysym.sym; | ||
| if (!input_mode) { |
There was a problem hiding this comment.
Handle keyboard input while numeric overlay is active
Keyboard handling is entirely skipped when input_mode is true, so if a user opens a numeric action via keyboard (Enter), they cannot edit digits, confirm, or cancel from the keyboard. On setups without a joystick (such as desktop environments used for local testing), choosing channel/txpower input leaves the app effectively stuck until the window is closed.
Useful? React with 👍 / 👎.
Motivation
Tools Menu.shwith a native SDL2 GUI that better fits the R36S device and provides a cleaner user experience.Description
cprog/tools-menu-sdl2/tools-menu-sdl2.c, a full-screen (640×480) SDL2 + SDL_ttf C program implementing the original shell menu items, command templates, and an in-app terminal output panel that captures command output.popeninto a scrollable right-hand “Terminal Output” pane usingrun_script_to_output/run_action.A/B/X/Ybutton behavior, and a numeric input overlay for actions that require numeric values.cprog/tools-menu-sdl2/CMakeLists.txt(pkg-config forsdl2+SDL2_ttf) and updateREADME.mdwith build/run instructions and control mappings.Testing
cmake -S cprog/tools-menu-sdl2 -B cprog/tools-menu-sdl2/build && cmake --build cprog/tools-menu-sdl2/build, which failed in this environment because thesdl2pkg-config package was not present.gcc -fsyntax-only cprog/tools-menu-sdl2/tools-menu-sdl2.c, which failed due to missing SDL2 headers in the environment.Codex Task