Skip to main content

Modes

Input mode flags​

Combine with OR and pass to lt_set_input_mode.

ConstantValueEffect
LT_INPUT_CURRENT0query the current mode without changing it
LT_INPUT_ESC1inside compat mode, report a lone Escape and an Alt-combination as two events. The compat default
LT_INPUT_ALT2inside compat mode, fold an Alt-combination into one event with LT_MOD_ALT
LT_INPUT_MOUSE4enable mouse reporting. SGR 1006 on POSIX, console mouse input on Windows
LT_INPUT_COMPAT8termbox2 semantics: control bytes in key, Shift+letter as an uppercase ch with no modifier, no kitty negotiation
LT_INPUT_RELEASE16deliver key-release events, action == LT_KEY_RELEASE. Off by default so code that switches on key or ch sees each keystroke once

Without any flag libterm uses the modern model. LT_INPUT_ESC and LT_INPUT_ALT have no effect outside LT_INPUT_COMPAT, because in the modern model Alt is always a modifier bit.

Output modes​

Pass one to lt_set_output_mode. lt_detect_color_depth returns one of LT_OUTPUT_TRUECOLOR, LT_OUTPUT_256 or LT_OUTPUT_NORMAL.

ConstantValueColour bits are
LT_OUTPUT_CURRENT0query the current mode without changing it
LT_OUTPUT_NORMAL1a named colour, LT_BLACK to LT_WHITE
LT_OUTPUT_2562an 8-bit palette index, 0 to 255
LT_OUTPUT_2163an index into the 6 by 6 by 6 colour cube
LT_OUTPUT_GRAYSCALE4an index into the 24-step grey ramp
LT_OUTPUT_TRUECOLOR524-bit RGB, packed with LT_RGB or LT_HEX

See Modes for the functions and Input and events for the models in full.