From 4d9598e7d0d6d45bf3db9305d365bd2967481bcd Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 18 Oct 2026 20:54:17 +0100 Subject: Send every input as a message (Pure 027's 4d): keys, text, timers, frames and pointing go to the inputs bound to them; a key's press then its release when a message takes it; vega_frame sends dt 1/60 to the frame input, deferring the save as frames were; a table's pointer is the input pointing at it, sent the item's position; a key's handler found by its input's number --- surfaces/access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'surfaces/access.c') diff --git a/surfaces/access.c b/surfaces/access.c index 9b5452b..24e3d00 100644 --- a/surfaces/access.c +++ b/surfaces/access.c @@ -76,7 +76,7 @@ static Object parse_path(const VegaAccess *a, const char *path) { if (o.kind == ROW && s->parts[o.part].kind == VEGA_FIELD) o.kind = NONE; if (o.kind == TITLE && s->title < 0) o.kind = NONE; if (o.kind == ENTRY && s->prompt < 0) o.kind = NONE; - if (o.kind == KEY && (o.key >= a->app->module->inputs || a->app->module->input[o.key].kind != PURE_KIND_KEY)) o.kind = NONE; + if (o.kind == KEY && (o.key >= a->app->module->inputs || a->app->module->input[o.key].binding != PURE_BIND_PRESS)) o.kind = NONE; return o; } @@ -98,9 +98,9 @@ static void path_of(const Object *o, char *out, size_t size) { /* The keys the screen answers: key inputs a handler takes. */ static bool bound_key(const PureModule *m, uint32_t input) { - if (m->input[input].kind != PURE_KIND_KEY) return false; + if (m->input[input].binding != PURE_BIND_PRESS) return false; for (uint32_t h = 0; h < m->handlers; ++h) - if (m->handler[h].event == 1 + 2 * input) return true; + if (m->handler[h].event == input) return true; return false; } -- cgit v1.2.3