input: remove translated

This commit is contained in:
Mitchell Hashimoto
2025-05-08 08:47:21 -07:00
parent 91d15c89bc
commit a3462dd2bd
9 changed files with 481 additions and 570 deletions

View File

@@ -56,7 +56,7 @@ pub const Event = struct {
// Write our key. If we have an invalid key we attempt to write
// the utf8 associated with it if we have it to handle non-ascii.
try writer.writeAll(switch (self.event.key) {
.invalid => if (self.event.utf8.len > 0) self.event.utf8 else @tagName(.invalid),
.unidentified => if (self.event.utf8.len > 0) self.event.utf8 else @tagName(self.event.key),
else => @tagName(self.event.key),
});
@@ -227,9 +227,9 @@ test "event string" {
const testing = std.testing;
const alloc = testing.allocator;
var event = try Event.init(alloc, .{ .key = .a });
var event = try Event.init(alloc, .{ .key = .key_a });
defer event.deinit(alloc);
var buf: [1024]u8 = undefined;
try testing.expectEqualStrings("Press: a", try event.label(&buf));
try testing.expectEqualStrings("Press: key_a", try event.label(&buf));
}