Repository navigation
fix(input): accept Windows keys sent without a scan code - #331
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Co-Authored-By: Joshua Tubbs <orin8722@gmail.com>
Co-Authored-By: Joshua Tubbs <orin8722@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…scan-keys Co-Authored-By: Joshua Tubbs <orin8722@gmail.com> # Conflicts: # CHANGELOG.md
…scan-keys Co-Authored-By: Joshua Tubbs <orin8722@gmail.com> # Conflicts: # CHANGELOG.md
Contributor
Author
|
Tested the real Windows game window: dev
The plain computer-use tool's Return already worked on dev here, so only explicit zero-scan and Unicode input reproduced the bug. Not tested on a real BrailleNote Evolve. |
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.
What changed and why
On some Windows input paths (BrailleNote Evolve, ChatGPT computer use) menus arrow fine but Enter does nothing. The shipped SDL2 (2.32.10,
vendor/sdl2) dropsWM_KEYDOWN/WM_KEYUPwhose lParam scan code is 0, except the four arrows, which have a VK fallback. So virtual-key-only Enter/Space/Escape/letters never become SDL events. Unicode-injected keys (VK_PACKET+WM_CHAR) never produce an SDL KeyDown either.New
app/win_keys.rssubclasses the SDL window right after creation (skipped under the dummy driver):MapVirtualKeyW(vk, MAPVK_VK_TO_VSC_EX)before SDL sees them. Any extended bit the sender set is kept.VK_PACKETkey-down is followed byWM_CHAR, the subclass sends SDL a key-down built fromVkKeyScanWjust before the character, then a matching key-up when the packet key is released. The menu then gets a realKey::Return/Space/letter with its text.Physical keyboards and screen-reader input already carry scan codes, so they pass through untouched.
What players or maintainers will notice
Enter, Space, keypad Enter, Escape and first-letter jumps now work from devices and tools that send keys without scan codes or as Unicode characters.
Tests and checks run
cargo fmt,cargo clippy -p freight-fate --all-targets -- -D warningswin_keyscargo test -p ff-core -p freight-fate: 3074 passed, 0 failed.--break-battery: 47/47 clean. Both ran before a timing-only move of the hook call; fmt, clippy, the unit tests and the build were re-run after it.SendInput/PostMessageand checking the speech transcript.WM_KEYDOWN; Unicode CR, LF and Space. Unicode letters typed into driver-name entry.WM_CHARCR (no key-down) is still ignored. That is intended.Not tested on a real BrailleNote Evolve.
Accessibility impact
Restores menu selection for braille notetakers and automation/computer-use tools on Windows. Keyboard and screen-reader paths that already worked are unchanged (checked through the transcript, as above).
Changelog
## UnreleasedinCHANGELOG.md, written in plain player language and matching the style of the existing entries.[skip changelog].Link to Devin session: https://app.devin.ai/sessions/4fea8f0471354515a76ff07b5fd21a00
Open in Devin Desktop: https://app.devin.ai/desktop/session/4fea8f0471354515a76ff07b5fd21a00?variant=devin
Requested by: @Orinks