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_input/index.html

Module Miaou_driver_matrix.Matrix_inputSource

Terminal input handling for the Matrix driver.

A dedicated Eio fiber reads keyboard and mouse input from the terminal, parsing escape sequences into events which are pushed into a mutex-protected queue. The main tick loop drains the queue each tick, giving sub-millisecond input latency regardless of TPS.

Lifecycle: create -> start -> (main loop calls drain) -> stop.

Sourcetype t

Input reader state.

Sourceval create : ?handle_sigint:bool -> Matrix_terminal.t -> t

Create a new input reader for the given terminal. Does not start the reader fiber — call start for that.

  • parameter handle_sigint

    If false, SIGINT (Ctrl+C) is not intercepted, allowing the app to receive it as a key event. Default: true

Sourceval start : t -> unit

Start the background reader fiber. Must be called after entering terminal raw mode, from inside an Eio switch (uses Miaou_helpers.Fiber_runtime.spawn).

Sourceval stop : t -> unit

Signal the reader fiber to stop.

Sourceval drain : t -> Matrix_io.event list

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