InputText: added mGuiInputTextCallbackData::EventActive helpers. (#9174)

This commit is contained in:
ocornut
2026-01-21 18:46:38 +01:00
parent d448045669
commit cb3b7ff4fb
3 changed files with 7 additions and 3 deletions

View File

@@ -2638,6 +2638,7 @@ struct ImGuiInputTextCallbackData
// - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state.
ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only // [Completion,History]
ImWchar EventChar; // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
bool EventActivated; // Input field just got activated // Read-only // [Always]
bool BufDirty; // Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always]
char* Buf; // Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
int BufTextLen; // Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()