Skip to main content

Module pointer

Module pointer 

Source
Expand description

The mouse, as shortcuts to keys (nothing here changes what a key does): the wheel presses arrows, a footer key click presses it, a form row click focuses and presses Space, a tab click selects it, a table or home click moves the cursor (double click: Enter), a plot click places the crosshair. Header drag moves a column (H/L), dragging the gap after sets width (</>); header double click sorts ([/]), gap double click fits (=); right click opens a cell’s key menu. Mouse input is never held: where a key would wait, it is dropped (crate::app::event_pump::EventPump::terminal_mouse). Click targets are recorded while drawing (record) by the widgets that lay them out.

Structs§

Clicked
A field a click focused: its kind, and whether the click acts on it as well (a list row’s first click only focuses it: Form::list_row).
EnableMouse
Ask for presses, releases, drag motion and the wheel, SGR-encoded for wide screens; not EnableMouseCapture, which also streams buttonless motion the app would discard. Undone by DisableMouseCapture.
FieldId
A form’s field as drawn: the form, by its type, and the field, by name. Kept as text so a frame’s regions need not know every form’s field type.
Pointing
What the last frame drew where, the last click, and a drag in progress.

Enums§

Drag
A drag in progress, from a press on the table’s header.
Hit
What a region of the frame is, for a click.
Pointer
What a mouse event comes to.
Target
Where a click or the wheel moves the cursor.

Constants§

DOUBLE_CLICK
Two clicks on one cell this close together are a double click.
WHEEL_ROWS
Rows a notch of the wheel moves.

Functions§

act_key
The key a click presses on a field it focused: Space acts on it (toggles, steps, opens, presses); a right click steps a choice back, as ← does, and only focuses anything else. A text field only takes focus.
capture
Take the mouse from the terminal when on (display.mouse, --mouse); off, the terminal keeps it, and selecting text works as it does anywhere.
chip_key
The key a chip’s label names, when it names one key: Enter, ^O, q, F1.
record
Say what a region of the frame being drawn is. Later regions lie on top.
record_field
Say that rect is form T’s row for field.
record_spans
Record a line’s spans that a click picks among: each (span, hit) names a span of line, drawn left-aligned from area.x on area.y. Their places are summed from the spans drawn, so they agree with the line on screen.
wanted
The mouse events the app acts on: a left press, its drag and release, a right press, and the wheel. Motion with no button down and the middle button are left alone.