Improve keyboard capture and Windows path resolution#107
Merged
Conversation
- 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.
Contributor
There was a problem hiding this comment.
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. |
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.
c64_path_kind_tenumeration to classify filesystem paths.c64_get_path_kindfunction to determine the kind of a given path.