From df2f9363170ed9972dc4d6e37c55efaa578102eb Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 30 Apr 2024 08:55:26 -0500 Subject: [PATCH] tty: handle key_release events --- src/Tty.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tty.zig b/src/Tty.zig index a6d0d01..38e1781 100644 --- a/src/Tty.zig +++ b/src/Tty.zig @@ -138,6 +138,16 @@ pub fn run( loop.postEvent(.{ .key_press = mut_key }); } }, + .key_release => |*key| { + if (@hasField(Event, "key_release")) { + // HACK: yuck. there has to be a better way + var mut_key = key; + if (key.text) |text| { + mut_key.text = cache.put(text); + } + loop.postEvent(.{ .key_release = mut_key }); + } + }, .mouse => |mouse| { if (@hasField(Event, "mouse")) { loop.postEvent(.{ .mouse = mouse });