Navigation
Addons
Plugins
Navigation
Addons
Plugins
This is an old revision of the document!
The ImGuiTextEditCallbackData structure contains information used for an InputText callback function. This can be useful for determining the type of callback that was fired as well as what data was used to cause the callback. The following data is exposed in this structure, to Lua addons:
struct ImGuiTextEditCallbackData { ImGuiInputTextFlags EventFlags; // ImGuiInputTextFlags_Callback... value from the ImGuiInputTextFlags_ enumeration. ImGuiInputTextFlags Flags; // The flags of the input creation call. bool ReadOnly; // The readonly flag of the input box. ImWchar EventChar; // The character that was input. ImGuiKey EventKey; // The key pressed to cause this event. char* Buf; // The current buffer of text in the input. int BufTextLen; // The current length of text in buf. int BufSize; // Maximum length that buf can hold. bool BufDirty; // Must be set to true if Buf or BufTextLen is modified. int CursorPos; // The current carrot position within the input text. int SelectionStart;// The selection start position. int SelectionEnd; // The selection end position. };
Lua should not attempt to edit the buffer as it can cause crashes due to how buffers are setup in this manner. Most of this structure is readonly and should only be used for reference.