mod(read_input): read user input from tty

This commit is contained in:
2024-11-05 19:59:55 +01:00
parent 9ef1081903
commit b0b262ae0b
6 changed files with 184 additions and 13 deletions

View File

@@ -50,6 +50,12 @@ pub fn main() !void {
try terminal.setCursorPositionHome();
log.debug("Size := [x: {d}, y: {d}]", .{ size.cols, size.rows });
},
.key => |key| {
log.debug("received key: {any}", .{key});
if (terminal.Key.matches(key, .{ .cp = 'q' })) {
app.quit = true; // TODO: who should emit the .quit event?
}
},
else => {},
}
const events = try layout.handle(event);