mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
inspector: fallback to unicode when key event is invalid
This prevents non-ascii characters like Ö from being displayed as invalid
This commit is contained in:
@ -52,7 +52,18 @@ pub const Event = struct {
|
||||
if (self.event.mods.ctrl) try writer.writeAll("Ctrl+");
|
||||
if (self.event.mods.alt) try writer.writeAll("Alt+");
|
||||
if (self.event.mods.super) try writer.writeAll("Super+");
|
||||
try writer.writeAll(@tagName(self.event.key));
|
||||
|
||||
try writer.writeAll(key: {
|
||||
if (self.event.key != .invalid) {
|
||||
break :key @tagName(self.event.key);
|
||||
}
|
||||
|
||||
if (self.event.utf8.len > 0) {
|
||||
break :key self.event.utf8;
|
||||
}
|
||||
|
||||
break :key @tagName(.invalid);
|
||||
});
|
||||
|
||||
// Deadkey
|
||||
if (self.event.composing) try writer.writeAll(" (composing)");
|
||||
|
Reference in New Issue
Block a user