Skip to content

Improve keyboard capture and Windows path resolution#107

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

Improve keyboard capture and Windows path resolution#107
chrisgleissner merged 6 commits into
mainfrom
fix/keyboard-edge-cases

Conversation

@chrisgleissner

Copy link
Copy Markdown
Owner
  • Introduced c64_path_kind_t enumeration to classify filesystem paths.
  • Implemented c64_get_path_kind function to determine the kind of a given path.
  • Updated various parts of the codebase to utilize the new path kind classification, including property changes and path validation in settings.
  • Enhanced keyboard interaction handling with new functions for escape and tab key detection.
  • Improved keyboard worker thread logic to handle state transitions and buffer management more effectively.
  • Added tests for path kind determination and keyboard worker functionality.

- Introduced `c64_path_kind_t` enumeration to classify filesystem paths.
- Implemented `c64_get_path_kind` function to determine the kind of a given path.
- Updated various parts of the codebase to utilize the new path kind classification, including property changes and path validation in settings.
- Enhanced keyboard interaction handling with new functions for escape and tab key detection.
- Improved keyboard worker thread logic to handle state transitions and buffer management more effectively.
- Added tests for path kind determination and keyboard worker functionality.
Copilot AI review requested due to automatic review settings March 17, 2026 19:21

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 improves input handling and filesystem-path robustness in c64stream by adding explicit path-kind classification and by reworking keyboard/playlist background work to behave better under load and on Windows.

Changes:

  • Introduces c64_path_kind_t + c64_get_path_kind() (with Windows wide-char handling) and updates settings import/export validation to use it.
  • Enhances keyboard interaction: adds escape/tab detection helpers and updates reboot/reset chord handling; reworks keyboard injection worker to use a state machine + condition variable.
  • Adds/extends script tests and CMake targets for path-kind detection, keyboard worker behavior, and playlist preloading/caching.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/c64-file.h Adds c64_path_kind_t and c64_get_path_kind() API.
src/c64-file.c Implements path normalization + cross-platform path-kind classification (Win32 wide APIs).
src/c64-interact-key.h Exposes new escape/tab helpers and reboot chord predicate.
src/c64-interact-key.c Implements escape/tab detection and reboot chord logic.
src/c64-keyboard.c Reworks keyboard worker (state machine, backoff, condvar); adds status updates.
src/c64-source.c Updates key event handling to track escape/tab state and trigger reboot chord once per press cycle.
src/c64-types.h Extends c64_source runtime keyboard state with escape/tab + reboot-consumed flags.
src/c64-properties.c Uses path-kind checks for import/export, improves playlist UI state for preloading, and triggers async playlist preload.
src/c64-automation-internal.h Adds preload-thread fields to the automation internal struct.
src/c64-automation.h Adds public APIs for async playlist preload + preloading status.
src/c64-automation.c Implements preload-thread lifecycle, async preload worker, and UI refresh enqueue on completion.
tests/script/test_file_paths.c New test covering c64_get_path_kind() behavior (dir, trailing separator, missing).
tests/script/test_keyboard_worker.c New test exercising worker batching, success path, and timeout path.
tests/script/test_interact_key.c Adds coverage for escape/tab detection and reboot chord predicate.
tests/script/test_automation_playlist.c Adds async preload + cached refresh checks (currently with large on-disk dataset and timing assertions).
tests/script/CMakeLists.txt Wires new script test executables into the build/ctest suite.

Comment thread src/c64-properties.c Outdated
Comment thread src/c64-properties.c Outdated
Comment thread tests/script/test_automation_playlist.c Outdated
Comment thread tests/script/test_automation_playlist.c Outdated
Comment thread src/c64-keyboard.c
Comment thread src/c64-automation.c
@chrisgleissner chrisgleissner changed the title Improve keyboard capture and path Windows resolution Improve keyboard capture and Windows path resolution Mar 17, 2026
@chrisgleissner chrisgleissner merged commit 1f1aea3 into main Mar 17, 2026
@chrisgleissner chrisgleissner deleted the fix/keyboard-edge-cases branch March 17, 2026 23:30
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