package miaou-driver-matrix

  1. Overview
  2. Docs
Miaou high-performance terminal driver with diff rendering

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
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.).

Sourcetype event =
  1. | Key of string
    (*

    Named key or character

    *)
  2. | MousePress of int * int * int
    (*

    Mouse button pressed at (row, col, button), 0-indexed. button: 0=left, 1=middle, 2=right

    *)
  3. | Mouse of int * int * int
    (*

    Mouse button released (click) at (row, col, button), 0-indexed. button: 0=left, 1=middle, 2=right

    *)
  4. | MouseDrag of int * int
    (*

    Mouse motion while button held, at (row, col)

    *)
  5. | Resize
    (*

    Viewport was resized

    *)
  6. | Refresh
    (*

    Time for service_cycle - rate limited

    *)
  7. | Idle
    (*

    No input, not time for refresh

    *)
  8. | Quit
    (*

    Exit signal received

    *)

Input events produced by any backend.

Sourcetype t = {
  1. write : string -> unit;
    (*

    Write an ANSI string to the output (terminal or WebSocket).

    *)
  2. drain : unit -> event list;
    (*

    Drain all pending events from the input queue (oldest first). Returns the empty list when nothing is buffered.

    *)
  3. size : unit -> int * int;
    (*

    Get current viewport dimensions as (rows, cols).

    *)
  4. invalidate_size_cache : unit -> unit;
    (*

    Invalidate cached size (e.g. after resize event).

    *)
}

I/O operations provided by a backend.