feat(event): introduce .bell system event
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 16m37s

This commit is contained in:
2025-11-17 18:30:31 +01:00
parent 3b5507ec1e
commit 28c733352e
3 changed files with 13 additions and 0 deletions

View File

@@ -915,6 +915,11 @@ pub fn Container(Model: type, Event: type) type {
relative_mouse.y -= this.origin.y;
try this.element.handle(model, .{ .mouse = relative_mouse });
},
.bell => {
// ring the terminal bell and do not propagate the event any further
_ = try terminal.ringBell();
return;
},
else => try this.element.handle(model, event),
}
for (this.elements.items) |*element| try element.handle(model, event);
@@ -961,6 +966,7 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const build_options = @import("build_options");
const input = @import("input.zig");
const terminal = @import("terminal.zig");
const isTaggedUnion = @import("event.zig").isTaggedUnion;
const Cell = @import("cell.zig");
const Color = @import("color.zig").Color;