summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 23:07:39 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitbc6fe168278957ad15cf87826c8410e7358e0849 (patch)
tree7b6ec8e9f3030ba77344c24f8ce387daca287ed5 /examples
parent87e8d3dee3bd57d28c42672d35ae214bbc058b9a (diff)
downloadsketchbook-bc6fe168278957ad15cf87826c8410e7358e0849.tar.gz
sketchbook-bc6fe168278957ad15cf87826c8410e7358e0849.zip
anim: Event.key, and the talk example runs in a window
An Event says its key (abi.Event.key), which the player and the talk example each spelled out by hand; `zig build talk` shows examples/talk.zig in a window on the generic host, its state under .zig-cache, and `zig build talk-lib --watch` beside it reloads every edit in place. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r--examples/talk.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/talk.zig b/examples/talk.zig
index f2a2d9c..2ad3d70 100644
--- a/examples/talk.zig
+++ b/examples/talk.zig
@@ -53,7 +53,7 @@ pub fn update(s: *State, in: *const sk.Input) void {
for (in.events) |e| switch (e.kind) {
// Every click is the presenter's, unless the talk takes it.
.mouse_up => ask.next = true,
- .key_down => switch (@as(sk.Key, @fromBackingInt(@intCast(@as(u8, @truncate(e.code)))))) {
+ .key_down => switch (e.key()) {
.space, .right, .page_down => ask.next = true,
.left, .page_up => ask.back = true,
.right_bracket => ask.next_slide = true,