package miaou-driver-matrix
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-driver-matrix.driver/Miaou_driver_matrix/Matrix_io/index.html
Module Miaou_driver_matrix.Matrix_ioSource
I/O abstraction for the Matrix driver.
Defines event types and I/O interfaces that decouple the main loop from a specific terminal implementation. This enables reuse of the Matrix rendering engine (buffer, diff, ANSI writer) with different backends (terminal, WebSocket, etc.).
type event = | Key of string(*Named key or character
*)| MousePress of int * int * int(*Mouse button pressed at (row, col, button), 0-indexed. button: 0=left, 1=middle, 2=right
*)| Mouse of int * int * int(*Mouse button released (click) at (row, col, button), 0-indexed. button: 0=left, 1=middle, 2=right
*)| MouseDrag of int * int(*Mouse motion while button held, at (row, col)
*)| Resize(*Viewport was resized
*)| Refresh(*Time for service_cycle - rate limited
*)| Idle(*No input, not time for refresh
*)| Quit(*Exit signal received
*)
Input events produced by any backend.
type t = {write : string -> unit;(*Write an ANSI string to the output (terminal or WebSocket).
*)drain : unit -> event list;(*Drain all pending events from the input queue (oldest first). Returns the empty list when nothing is buffered.
*)size : unit -> int * int;(*Get current viewport dimensions as (rows, cols).
*)invalidate_size_cache : unit -> unit;(*Invalidate cached size (e.g. after resize event).
*)
}I/O operations provided by a backend.