examples: clear textinput on enter

This commit is contained in:
Tim Culverhouse 2024-03-19 13:24:17 -05:00
parent 8a5fe1a8ab
commit d40fb7cbdb

View file

@ -77,6 +77,8 @@ pub fn main() !void {
vx.queueRefresh(); vx.queueRefresh();
} else if (key.matches('n', .{ .ctrl = true })) { } else if (key.matches('n', .{ .ctrl = true })) {
try vx.notify("vaxis", "hello from vaxis"); try vx.notify("vaxis", "hello from vaxis");
} else if (key.matches(vaxis.Key.enter, .{})) {
text_input.clearAndFree();
} else { } else {
try text_input.update(.{ .key_press = key }); try text_input.update(.{ .key_press = key });
} }