doc: clarify UTF-8 text handling in ghostty_key_event_get_composing

This commit is contained in:
Elias Andualem
2026-03-28 12:18:23 +08:00
parent 12458e3ace
commit 01abf4af21

View File

@@ -425,7 +425,13 @@ void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool composing);
bool ghostty_key_event_get_composing(GhosttyKeyEvent event);
/**
* Set the UTF-8 text generated by the key event.
* 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.