Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Miaou_driver_matrix.Matrix_selectionSourceTerminal text selection for the Matrix driver.
Handles mouse-based text selection with visual highlighting and clipboard integration. Selection works globally across any rendered content - no widget-specific code required.
Usage:
let selection = Matrix_selection.create () in
(* On mouse press: *)
Matrix_selection.start_selection selection ~row ~col ~get_char ~cols ;
(* On mouse drag: *)
Matrix_selection.update_selection selection ~row ~col ;
(* On mouse release: *)
match Matrix_selection.finish_selection selection ~get_char ~cols with
| Some text -> Matrix_selection.copy_to_clipboard text
| None -> ()Selection is drawn using reverse video style as an overlay on the normal buffer content.
Selection state.
Whether the selection is a single point (single click, no drag). Used to distinguish clicks from text selection.
Whether this is a multi-click (double or triple click). Used to pass double-clicks to widgets.
Check if a cell at (row, col) is within the current selection.
val start_selection :
t ->
row:int ->
col:int ->
get_char:(row:int -> col:int -> string) ->
cols:int ->
unitStart a new selection at the given position (on mouse press). Detects double-click (select word) and triple-click (select line).
Update the selection endpoint (on mouse drag).
val finish_selection :
t ->
get_char:(row:int -> col:int -> string) ->
cols:int ->
string optionFinish selection and extract the selected text.
val apply_highlight :
t ->
set_style:(row:int -> col:int -> reverse:bool -> unit) ->
rows:int ->
cols:int ->
unitApply selection highlight overlay to buffer cells. Cells within selection have their reverse style set.
Copy text to system clipboard using the Clipboard capability. Does nothing if Clipboard capability is not registered.