diff options
| author | gbc dev <gbc@localhost> | 2026-07-04 22:46:11 +0200 |
|---|---|---|
| committer | gbc dev <gbc@localhost> | 2026-07-04 22:46:11 +0200 |
| commit | 54081ce90bf2b4cad803ab78db65b91c1217cc83 (patch) | |
| tree | f5e51723c2e9a40265b5251b07870b48c81d048d /src/render.h | |
| parent | renderer: inter-frame diffing to minimize terminal output (diff) | |
| download | sl0pboy-54081ce90bf2b4cad803ab78db65b91c1217cc83.tar.gz sl0pboy-54081ce90bf2b4cad803ab78db65b91c1217cc83.tar.xz sl0pboy-54081ce90bf2b4cad803ab78db65b91c1217cc83.zip | |
input: external control channel via FIFO
Adds --fifo [path] opening a named pipe that accepts button commands from any
process. Supports momentary taps (a, start, name:N), deterministic hold/release
(+name / -name), and 'release'. Merges with keyboard input; held state carries
true key-up semantics the terminal can't provide. GBC_INPUT_DEBUG traces state.
Diffstat (limited to 'src/render.h')
| -rw-r--r-- | src/render.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/render.h b/src/render.h index 93ca32a..27da080 100644 --- a/src/render.h +++ b/src/render.h @@ -7,7 +7,12 @@ void term_init(void); void term_restore(void); void render_frame(GB *gb); void render_force_full(void); // force a complete repaint next frame -// Poll keyboard, update gb->buttons. Returns false if quit requested. +// Poll keyboard + control FIFO, update gb->buttons. False if quit requested. bool input_poll(GB *gb); +// Optional external control channel: a named pipe (FIFO) that accepts button +// commands (see README). Safe to call once at startup. +void input_open_fifo(const char *path); +void input_close_fifo(void); + #endif |
