From d40fb7cbdb65ea81f21e0bfd09c61c3aa10b6e05 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 19 Mar 2024 13:24:17 -0500 Subject: [PATCH] examples: clear textinput on enter --- examples/text_input.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/text_input.zig b/examples/text_input.zig index 0f350ee..0d7f8a2 100644 --- a/examples/text_input.zig +++ b/examples/text_input.zig @@ -77,6 +77,8 @@ pub fn main() !void { vx.queueRefresh(); } else if (key.matches('n', .{ .ctrl = true })) { try vx.notify("vaxis", "hello from vaxis"); + } else if (key.matches(vaxis.Key.enter, .{})) { + text_input.clearAndFree(); } else { try text_input.update(.{ .key_press = key }); }