Text Input
InputText
Widget label
Text buffer
Buffer size including null terminator
Input flags (see ImGuiInputTextFlags_)
Optional callback function
Optional user data passed to callback
True when value has been modified
InputTextMultiline
Widget label
Text buffer
Buffer size including null terminator
Size of the input area
Input flags
Optional callback function
Optional user data
True when value has been modified
InputTextWithHint
Widget label
Hint text displayed when empty
Text buffer
Buffer size
Input flags
True when value has been modified
Numeric Input
InputFloat
Widget label
Pointer to float value
Step size for +/- buttons
Fast step size (when holding Shift)
Display format
Input flags
True when value has been modified
InputFloat2
Widget label
Array of 2 floats
Display format
Input flags
True when value has been modified
InputFloat3
Widget label
Array of 3 floats
Display format
Input flags
True when value has been modified
InputFloat4
Widget label
Array of 4 floats
Display format
Input flags
True when value has been modified
InputInt
Widget label
Pointer to int value
Step size for +/- buttons
Fast step size (when holding Shift)
Input flags
True when value has been modified
InputInt2
InputInt3
InputInt4
InputDouble
Widget label
Pointer to double value
Step size for +/- buttons
Fast step size
Display format
Input flags
True when value has been modified
Input Text Flags
ImGuiInputTextFlags_
Flags forInputText(), InputTextMultiline() functions.
Basic Filters
| Flag | Description |
|---|---|
ImGuiInputTextFlags_CharsDecimal | Allow 0123456789.+-*/ |
ImGuiInputTextFlags_CharsHexadecimal | Allow 0123456789ABCDEFabcdef |
ImGuiInputTextFlags_CharsScientific | Allow 0123456789.+-*/eE |
ImGuiInputTextFlags_CharsUppercase | Turn a..z into A..Z |
ImGuiInputTextFlags_CharsNoBlank | Filter out spaces, tabs |
Input Behavior
| Flag | Description |
|---|---|
ImGuiInputTextFlags_AllowTabInput | Pressing TAB inputs a ‘\t’ character |
ImGuiInputTextFlags_EnterReturnsTrue | Return true when Enter is pressed |
ImGuiInputTextFlags_EscapeClearsAll | Escape key clears content |
ImGuiInputTextFlags_CtrlEnterForNewLine | In multi-line mode: validate with Enter, add new line with Ctrl+Enter |
Options
| Flag | Description |
|---|---|
ImGuiInputTextFlags_ReadOnly | Read-only mode |
ImGuiInputTextFlags_Password | Display all characters as ’*‘ |
ImGuiInputTextFlags_AlwaysOverwrite | Overwrite mode |
ImGuiInputTextFlags_AutoSelectAll | Select entire text when first taking focus |
ImGuiInputTextFlags_NoHorizontalScroll | Disable following cursor horizontally |
ImGuiInputTextFlags_NoUndoRedo | Disable undo/redo |
ImGuiInputTextFlags_ElideLeft | Elide left side when text doesn’t fit |
Callbacks
| Flag | Description |
|---|---|
ImGuiInputTextFlags_CallbackCompletion | Callback on pressing TAB |
ImGuiInputTextFlags_CallbackHistory | Callback on pressing Up/Down arrows |
ImGuiInputTextFlags_CallbackAlways | Callback on each iteration |
ImGuiInputTextFlags_CallbackCharFilter | Callback on character inputs |
ImGuiInputTextFlags_CallbackResize | Callback on buffer capacity changes |
ImGuiInputTextFlags_CallbackEdit | Callback on any edit |