Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of Space key combinations (#16645)
This fixes two issues where the `Space` key wasn't being handled correctly: * Keyboards with an `AltGr`+`Space` mapping were not generating the expected character. * Pressing a dead key followed by `Space` is supposed to generate the accent character associated with that key, but it wasn't doing so. ## References and Relevant Issues These were both regressions from the keyboard refactor in PR #16511. ## Detailed Description of the Pull Request / Additional comments The problem was that we were treating `VK_SPACE` as a "functional" key, which means it gets hardcoded VT mappings which take precedence over whatever is in the keyboard layout. This was deemed necessary to deal with the fact that many keyboards incorrectly map `Ctrl`+`Space` as a `SP` character, when it's expected to be `NUL`. I've now dropped `VK_SPACE` from the functional mapping table and allow it be handled by the default mapping algorithm for "graphic" keys. However, I've also introduced a special case check for `Ctrl`+`Space` (and other modifier variants), so we can bypass any incorrect keyboard layouts for those combinations. ## Validation Steps Performed I couldn't test with a French-BEPO keyboard layout directly, because the MS Keyboard Layout Creator wouldn't accept a `Space` key mapping that wasn't whitespace. However, if I remapped the `AltGr`+`Space` combo to `LF`, I could confirm that we are now generating that correctly. I've also tested the dead key `Space` combination on various keyboard layouts and confirmed that that is now working correctly, and checked that the `Ctrl`+`Space` combinations are still working too. Closes #16641 Closes #16642
- Loading branch information