Repository navigation
Conversation
The macOS and X11 observers report the space bar as the named key "space" with no character. merge_consecutive_keyboard_events dropped it from merged text, and a lone space became an empty key.type that the flow adapter rejected as an unmapped key, so a recording with a space in it could not be converted.
This branch has not been deployed
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.
Found while recording a TextEdit demonstration on macOS: converting the recording failed with
unmapped key 'space'.The macOS and X11 input observers report the space bar as the named key
spacewith no character. Two places then lost it:merge_consecutive_keyboard_events(capture) builds the typed text from key characters only, so a space typed while neighbouring letters overlapped was dropped from the merged text, and a lone space became aKeyTypeEventwith empty text.key.typeas a named special key and looks it up in_KEY_NAME_MAP, which has nospace, so it raised.Changes:
_typed_characterhelper returns" "for the named space key; the shift-printable check and the text join use it. Ctrl+space and other chords still become shortcuts.spacein an empty-textkey.typejoins the current text run as" ", so recordings made with an already released capture also convert.Testing:
packages/capture:pytest tests/test_processing.py20 passed. Four new tests: lone named space, named space between overlapping letters, shift+space, ctrl+space stays a shortcut. Control with the baseprocessing.py: the three space-as-text tests fail; the ctrl+space test passes on both, as a guard.packages/flow:pytest tests/test_capture_adapter.py -n 455 passed. New test converts "synthetic", named space, "note" and expects one type event "synthetic note". Controls: base adapter plus base capture fails; either fix alone passes.ruff checkpasses on the changed files.ruff format --checkreports the two capture files, but they are already unformatted on main, so I left formatting alone.Not tested: a live X11 recording, and Windows (its observer already reports a space character).