examples(text_input): use all kitty flags

This commit is contained in:
Tim Culverhouse 2024-06-05 12:37:27 -05:00
parent 91152eecdf
commit 3c29f18251

View file

@ -39,7 +39,9 @@ pub fn main() !void {
const writer = buffered_writer.writer().any(); const writer = buffered_writer.writer().any();
// Initialize Vaxis // Initialize Vaxis
var vx = try vaxis.init(alloc, .{}); var vx = try vaxis.init(alloc, .{
.kitty_keyboard_flags = .{ .report_events = true },
});
defer vx.deinit(alloc, tty.anyWriter()); defer vx.deinit(alloc, tty.anyWriter());
var loop: vaxis.Loop(Event) = .{ var loop: vaxis.Loop(Event) = .{
@ -64,13 +66,12 @@ pub fn main() !void {
var text_input = TextInput.init(alloc, &vx.unicode); var text_input = TextInput.init(alloc, &vx.unicode);
defer text_input.deinit(); defer text_input.deinit();
// Sends queries to terminal to detect certain features. This should
// _always_ be called, but is left to the application to decide when
// try vx.queryTerminal();
try vx.setMouseMode(writer, true); try vx.setMouseMode(writer, true);
try buffered_writer.flush(); try buffered_writer.flush();
// Sends queries to terminal to detect certain features. This should
// _always_ be called, but is left to the application to decide when
try vx.queryTerminal(tty.anyWriter(), 1 * std.time.ns_per_s);
// The main event loop. Vaxis provides a thread safe, blocking, buffered // The main event loop. Vaxis provides a thread safe, blocking, buffered
// queue which can serve as the primary event queue for an application // queue which can serve as the primary event queue for an application