From 1346e3535d690854feb074f654bfcf46b36a8999 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 25 Nov 2024 21:21:35 +0100 Subject: [PATCH] fix: map VK_OEM_102 to backslash This is commonly the backslash key on internation keyboard layouts. Also, log a warning when receiving events for unmapped virtual key codes. --- src/tty.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tty.zig b/src/tty.zig index eab80de..bf6ae22 100644 --- a/src/tty.zig +++ b/src/tty.zig @@ -469,9 +469,14 @@ pub const WindowsTty = struct { 0xc0 => '`', 0xdb => '[', 0xdc => '\\', + 0xe2 => '\\', 0xdd => ']', 0xde => '\'', - else => return null, + else => { + const log = std.log.scoped(.vaxis); + log.warn("unknown wVirtualKeyCode: 0x{x}", .{event.wVirtualKeyCode}); + return null; + }, }; if (std.unicode.utf16IsHighSurrogate(base_layout)) {