$ rezi
Protocol

ABI

Rezi pins a small set of ABI constants that must match the Zireael engine. These values are exported from @rezi-ui/core so wrappers and tooling can validate compatibility.

Rezi pins a small set of ABI constants that must match the Zireael engine. These values are exported from @rezi-ui/core so wrappers and tooling can validate compatibility.

Version pins

ConstantValueNotes
ZR_ENGINE_ABI_MAJOR1Engine ABI major version
ZR_ENGINE_ABI_MINOR1Engine ABI minor version
ZR_ENGINE_ABI_PATCH0Engine ABI patch version
ZR_DRAWLIST_VERSION_V11ZRDL v1 drawlist format
ZR_DRAWLIST_VERSION_V22ZRDL v2 drawlist format
ZR_EVENT_BATCH_VERSION_V11ZREV v1 event batch format
ZR_UNICODE_VERSION_MAJOR15Unicode version (major)
ZR_UNICODE_VERSION_MINOR1Unicode version (minor)
ZR_UNICODE_VERSION_PATCH0Unicode version (patch)

Magic numbers

ConstantValueMeaning
ZRDL_MAGIC0x4c44525a"ZRDL" as little-endian u32
ZREV_MAGIC0x5645525a"ZREV" as little-endian u32

Cursor shapes

ConstantValueMeaning
ZR_CURSOR_SHAPE_BLOCK0Block cursor
ZR_CURSOR_SHAPE_UNDERLINE1Underline cursor
ZR_CURSOR_SHAPE_BAR2Bar cursor

Result codes

ZrResult values are returned by engine FFI calls.

NameValueMeaning
OK0Success
ERR_INVALID_ARGUMENT-1Invalid argument or impossible value
ERR_OOM-2Allocation failed
ERR_LIMIT-3Buffer too small or cap exceeded
ERR_UNSUPPORTED-4Unknown version/opcode/feature
ERR_FORMAT-5Malformed binary data
ERR_PLATFORM-6OS/terminal error

Key codes & modifiers

Key code and modifier constants are ABI-pinned and exported from @rezi-ui/core.

Special keys

KeyCode
ZR_KEY_UNKNOWN0
ZR_KEY_ESCAPE1
ZR_KEY_ENTER2
ZR_KEY_TAB3
ZR_KEY_BACKSPACE4
KeyCode
ZR_KEY_INSERT10
ZR_KEY_DELETE11
ZR_KEY_HOME12
ZR_KEY_END13
ZR_KEY_PAGE_UP14
ZR_KEY_PAGE_DOWN15

Arrow keys

KeyCode
ZR_KEY_UP20
ZR_KEY_DOWN21
ZR_KEY_LEFT22
ZR_KEY_RIGHT23

Function keys

KeyCode
ZR_KEY_F1100
ZR_KEY_F2101
ZR_KEY_F3102
ZR_KEY_F4103
ZR_KEY_F5104
ZR_KEY_F6105
ZR_KEY_F7106
ZR_KEY_F8107
ZR_KEY_F9108
ZR_KEY_F10109
ZR_KEY_F11110
ZR_KEY_F12111

ASCII keys

Printable ASCII keys use their codepoints:

  • ZR_KEY_SPACE is 32
  • Letters A-Z use 65-90
  • Digits 0-9 use 48-57
  • Common punctuation/symbols use 32-126

Modifiers (bitmask)

ModifierBit
ZR_MOD_SHIFT1 \<< 0
ZR_MOD_CTRL1 \<< 1
ZR_MOD_ALT1 \<< 2
ZR_MOD_META1 \<< 3

When a ZREV key event is parsed, mods is the bitmask of these flags.

Key name mapping

The parser accepts the following key names in keybinding strings:

  • escape, esc
  • enter, return
  • tab, backspace, space
  • insert, delete, del, home, end, pageup, pagedown
  • up, down, left, right
  • f1 ... f12

Modifier names accepted in keybinding strings:

  • shift
  • ctrl, control
  • alt
  • meta, cmd, command, win, super

ZREV record kinds

ZREV events use a numeric record kind in the binary format:

KindValueMeaning
key1Key press/release/repeat
text2Unicode codepoint input
paste3Bracketed paste bytes
mouse4Mouse move/click/drag/scroll
resize5Terminal size change
tick6Frame timing delta
user7App-defined payload

Mouse kinds:

Mouse kindValue
move1
press2
release3
drag4
scroll5

On this page