ghostty_key_event_set_utf8 function
Set the UTF-8 text generated by the key for the current keyboard layout.
Must contain the unmodified character before any Ctrl/Meta transformations. The encoder derives modifier sequences from the logical key and mods bitmask, not from this text. Do not pass C0 control characters (U+0000-U+001F, U+007F) or platform function key codes (e.g. macOS PUA U+F700-U+F8FF); pass NULL instead and let the encoder use the logical key.
The key event does NOT take ownership of the text pointer. The caller must ensure the string remains valid for the lifetime needed by the event.
@param event The key event handle, must not be NULL @param utf8 The UTF-8 text to set (or NULL for empty) @param len Length of the UTF-8 text in bytes
@ingroup key
Implementation
@ffi.Native<
ffi.Void Function(GhosttyKeyEvent, ffi.Pointer<ffi.Char>, ffi.Size)
>()
external void ghostty_key_event_set_utf8(
GhosttyKeyEvent event,
ffi.Pointer<ffi.Char> utf8,
int len,
);