etch/erlang/input

Values

pub fn get_cursor_position() -> Result(
  #(Int, Int),
  event.EventError,
)

Returns cursor position. This function shouldn’t be called in a tight loop. It’s fine to call it when responding to specific user input (e.g., after a key press), but avoid calling it on every loop iteration.

pub fn get_keyboard_enhancement_flags() -> Result(
  List(event.KeyboardEnhancementFlag),
  event.EventError,
)

Get keyboard enhancement flags. See https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement This function shouldn’t be called in a tight loop. It’s fine to call it when responding to specific user input (e.g., after a key press), but avoid calling it on every loop iteration.

pub fn init_event_server() -> Nil

Initializes the event server responsible for listening for events.

pub fn poll(
  timeout: Int,
) -> option.Option(Result(event.Event, event.EventError))

Checks if there is an Event available. Returns None if no events were received within the timeout. See also read.

pub fn read() -> option.Option(
  Result(event.Event, event.EventError),
)

Checks if there is an Event available. Waits forever for an available event. See also poll.

Search Document