Skip to content

Fix keyboard mapping, automation refresh and HVSC indexing#104

Merged
chrisgleissner merged 6 commits into
mainfrom
fix/keyboard
Mar 17, 2026
Merged

Fix keyboard mapping, automation refresh and HVSC indexing#104
chrisgleissner merged 6 commits into
mainfrom
fix/keyboard

Conversation

@chrisgleissner

@chrisgleissner chrisgleissner commented Mar 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Decouple script-driven property refreshes from playlist rebuilds
  • Add shared interact key translation and arrow-key alias handling
  • Tighten HVSC songlength discovery, improve large-library indexing, and add deterministic tests
  • Expose Reset (ESC+SHIFT) and Reboot (ESC+SHIFT+META) keyboard shortcuts

Validation

  • ./build --tests --script-tests

Copilot AI review requested due to automatic review settings March 16, 2026 20:43
@chrisgleissner chrisgleissner changed the title Fix automation refresh and HVSC indexing Fix keyboard mapping, automation refresh and HVSC indexing Mar 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/c64-automation-hvsc.c Outdated
Comment thread src/c64-automation-hvsc.c Outdated
Comment thread src/c64-automation-internal.h
Comment thread tests/script/test_automation_playlist.c
- 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
@chrisgleissner chrisgleissner merged commit a8ca16f into main Mar 17, 2026
41 checks passed
@chrisgleissner chrisgleissner deleted the fix/keyboard branch March 17, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants