From c4b5372253d745a6d9406a500b38d45dedeb0b4e Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 1 Jul 2024 19:51:11 +0200 Subject: [PATCH] fix(windows): unbreak shifted characters --- src/windows/Tty.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/windows/Tty.zig b/src/windows/Tty.zig index 7694ad3..503d7a6 100644 --- a/src/windows/Tty.zig +++ b/src/windows/Tty.zig @@ -301,11 +301,12 @@ pub fn eventFromRecord(self: *Tty, record: *const INPUT_RECORD, state: *EventSta return null; } - const codepoint: u21 = base_layout; + var codepoint: u21 = base_layout; var text: ?[]const u8 = null; switch (event.uChar.UnicodeChar) { 0x00...0x1F => {}, - else => { + else => |cp| { + codepoint = cp; const n = try std.unicode.utf8Encode(codepoint, &self.buf); text = self.buf[0..n]; },