macos: do not send UTF-8 PUA codepoints to key events

Fixes #7337

AppKit encodes functional keys as PUA codepoints. We don't want to send
that down as valid text encoding for a key event because KKP uses that
in particular to change the encoding with associated text.

I think there may be a more specific solution to this by only doing this
within the KKP encoding part of KeyEncoder but that was filled with edge
cases and I didn't want to risk breaking anything else.
This commit is contained in:
Mitchell Hashimoto
2025-05-12 11:12:04 -07:00
parent 6723c308be
commit ecda5ec327
3 changed files with 28 additions and 8 deletions

View File

@@ -83,6 +83,15 @@ pub const Flags = packed struct(u5) {
report_all: bool = false,
report_associated: bool = false,
/// Sets all modes on.
pub const @"true": Flags = .{
.disambiguate = true,
.report_events = true,
.report_alternates = true,
.report_all = true,
.report_associated = true,
};
pub fn int(self: Flags) u5 {
return @bitCast(self);
}