T44: round 1 fixes: under kitty's flags the legacy bytes a key falls back to keep gpui's character, so Option-Shift-[ with only events set sends ESC { again; a key that is down is known by its key code on macOS and its virtual key on Windows, so its release goes out, as a record where its press did, though Shift came up first; shot posts a press or a release alone with down: and up:
CI / platforms (windows-latest) (push) Failing after 11s
CI / platforms (ubuntu-24.04) (push) Successful in 9m23s
CI / macos (push) Successful in 24m8s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-18 04:21:52 -04:00
1 parent fc10c4d491
commit 6f8bfaeff8
8 files changed
+90 -47

No files matched your search

+3
View File
@@ -58,6 +58,8 @@ pub struct KeyFacts {
pub repeat: bool,
/// The key's own character, where gpui named the one Shift made and dropped Shift.
pub unshifted: Option<char>,
/// AppKit's key code, which Shift does not change.
pub code: Option<u16>,
}
/// The facts of the key event AppKit is handling now, which gpui named `name`, with `shift` or not.
@@ -89,6 +91,7 @@ pub fn key_facts(name: &str, shift: bool) -> anyhow::Result<KeyFacts> {
right_option: flags & RIGHT_OPTION != 0,
repeat,
unshifted,
code: Some(code),
})
}