diff options
| author | eunhhu <[email protected]> | 2026-09-27 19:37:33 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-27 19:37:33 +0100 |
| commit | 5fe8104744d3e0a48674b1368db6fd104a10bdd4 (patch) | |
| tree | ed9ea83c6a84a09136f40dc7ff6141968e75faec /surfaces/input.c | |
| parent | ad3eb77af098f34c1ea8cb50f468a8b75fb7d61c (diff) | |
| download | vega-5fe8104744d3e0a48674b1368db6fd104a10bdd4.tar.gz vega-5fe8104744d3e0a48674b1368db6fd104a10bdd4.zip | |
Show a Pure node's app on its display, as a surface in the node
The vega host builds a second way, as build/vega-surface.so, which
pure-serve maps and runs beside its connection threads (pure-serve
--surface vega-surface.so -- display ..., Pure's design 010). There the
app it draws is a reader of the node's last save, read where it is,
and what people type goes to the node's owner: a key press as the key
input's event, the typed line as the text input's, each applied and
saved with the node's requests. It waits on its input devices and the
node's changes descriptor together, leaves timers and signals to the
node, and stops with it. The library calls the app model pure-serve
exports and links none of its own; it exports pure_surface_run alone.
Without --live or --input it takes no input: the node's saves alone draw
it.
The check gives a node an item over HTTP, then runs the display in the
node with recorded keys (an item, Enter, Tab, Space): the last frame is
the one vega tui draws for the same state and keys, it came back from
the display controller as drawn, and the node's views show both items.
Diffstat (limited to 'surfaces/input.c')
| -rw-r--r-- | surfaces/input.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/surfaces/input.c b/surfaces/input.c index b358d47..9403a75 100644 --- a/surfaces/input.c +++ b/surfaces/input.c @@ -84,6 +84,7 @@ VegaInput *vega_input_open(const char *const *paths, unsigned count, unsigned wi VegaInput *input = calloc(1, sizeof(*input)); if (!input) return NULL; input->width = width, input->height = height, input->x = (int)width / 2, input->y = (int)height / 2; + if (!paths) return input; /* none */ if (count) { /* files of recorded events, positions already in screen pixels */ for (unsigned i = 0; i < count; ++i) { int fd = open(paths[i], O_RDONLY | O_CLOEXEC); |
