Fix keyboard mapping, automation refresh and HVSC indexing#104
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors a few UI/input/automation helpers into dedicated modules, adds script-level tests for them, and tightens playlist scanning safety while expanding path buffer sizes to support longer filesystem paths.
Changes:
- Add reusable helpers for playlist UI windowing (
c64-playlist-window) and for suppressing one playlist rebuild during script-only UI refresh (c64-properties-refresh). - Centralize OBS key event → key-code translation (
c64-interact-key) and add arrow-key aliasing in keymap conversion for compatibility with existing keymap files. - Harden local playlist scanning (refuse root scans, track unreadable folders) and expand path buffers across automation/HVSC to
C64_AUTOMATION_PATH_MAX; add/extend script tests and CMake wiring.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/script/test_properties_refresh.c | Adds a small executable test for one-shot playlist rebuild suppression logic. |
| tests/script/test_playlist_window.c | Adds tests for playlist window start/count computation. |
| tests/script/test_interact_key.c | Adds tests for key translation + keymap arrow compatibility; includes minimal OBS stubs. |
| tests/script/test_automation_playlist.c | Expands automation playlist test coverage (jump, root-scan refusal, songlength auto-detect, large library scan). |
| tests/script/CMakeLists.txt | Registers new script tests as CMake executables + CTest entries. |
| src/c64-types.h | Adds playlist_refresh_suppressed_once flag to struct c64_source. |
| src/c64-source.c | Routes key translation through new c64-interact-key helper. |
| src/c64-properties.c | Uses new playlist window helper; adds one-shot suppression check on properties open; reduces UI playlist limit. |
| src/c64-properties-refresh.h | Declares properties refresh helper functions. |
| src/c64-properties-refresh.c | Implements one-shot suppression + force UI update marker. |
| src/c64-playlist-window.h | Declares playlist window computation helper. |
| src/c64-playlist-window.c | Implements playlist window computation helper. |
| src/c64-keyboard.c | Adds arrow key alias handling + refactors output emission for keymap entries. |
| src/c64-interact-key.h | Declares key translation API + result enum. |
| src/c64-interact-key.c | Implements native key/text → canonical key-code translation (incl. warm start). |
| src/c64-automation.h | Introduces C64_AUTOMATION_PATH_MAX and widens config paths. |
| src/c64-automation.c | Widens internal buffers; persists discovered songlengths path into config. |
| src/c64-automation-playlist.c | Adds safety checks (no root scans), uses OBS dir APIs on Windows, tracks unreadable folders, widens buffers. |
| src/c64-automation-internal.h | Widens stored playlist entry paths and current file path buffers. |
| src/c64-automation-hvsc.h | Widens HVSC songlength DB source path buffer. |
| src/c64-automation-hvsc.c | Reworks songlengths detection to check specific DOCUMENTS candidates using widened buffers. |
| CMakeLists.txt | Adds new source files to the main target build. |
…ent_index function and update related logic
- Introduced a new structure `c64_interact_key_t` to hold key code and text. - Implemented `c64_interact_translate_key_event` for translating native key events into a standardized format. - Enhanced key normalization functions to support various key identifiers, including function keys and modifiers. - Updated `c64_keymap_convert` to accept both key code and text for improved mapping. - Added tests for key translation and normalization, ensuring compatibility with multiple keymaps. - Refactored existing keymap functions to utilize the new normalization and translation logic.
…update related logic in automation and tests
…ME with new sections, improve key event handling, and add playlist window management features
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation