ltk::osk

Module layout

Source
Expand description

A keyboard layout as a data file: layers of rows of keys, and the variants a long press offers.

Files are JSON, one per layout, named by their language tag (es.json). A layer is a list of rows; a key is a bare string for the text it types, or an object with an action, a named key (Escape, Left…), a modifier (ctrl, alt), a width in key units (default 1) and a label. The shift layer is derived from base by uppercasing when a file has none. variants maps a key’s text to the alternatives a long press offers. Files named bar-*.json are rows laid above any language’s layout, not layouts of their own: bar-terminal.json is the row of keys a terminal needs.

Structs§

Enums§

  • What a key does besides typing.
  • A sticky modifier: held for the next key, then released.

Constants§

Functions§

  • Names of every installed language layout, without duplicates, sorted; the bar-* files are rows, not layouts.
  • The English layout compiled in, for a system with none installed.
  • The installed layout name, or None when no directory has it or it does not parse.
  • Directories searched for <name>.json, highest priority first.
  • The terminal row: the installed bar-terminal.json, or the one compiled in.