Skip to main content

Text Input

InputText

Single-line text input.
const char*
Widget label
char*
Text buffer
size_t
Buffer size including null terminator
ImGuiInputTextFlags
default:"0"
Input flags (see ImGuiInputTextFlags_)
ImGuiInputTextCallback
default:"NULL"
Optional callback function
void*
default:"NULL"
Optional user data passed to callback
bool
True when value has been modified

InputTextMultiline

Multi-line text input.
const char*
Widget label
char*
Text buffer
size_t
Buffer size including null terminator
const ImVec2&
default:"ImVec2(0, 0)"
Size of the input area
ImGuiInputTextFlags
default:"0"
Input flags
ImGuiInputTextCallback
default:"NULL"
Optional callback function
void*
default:"NULL"
Optional user data
bool
True when value has been modified

InputTextWithHint

Input with a hint/placeholder text.
const char*
Widget label
const char*
Hint text displayed when empty
char*
Text buffer
size_t
Buffer size
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

Numeric Input

InputFloat

Input a float value.
const char*
Widget label
float*
Pointer to float value
float
default:"0.0f"
Step size for +/- buttons
float
default:"0.0f"
Fast step size (when holding Shift)
const char*
default:"%.3f"
Display format
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

InputFloat2

Input 2 float values.
const char*
Widget label
float[2]
Array of 2 floats
const char*
default:"%.3f"
Display format
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

InputFloat3

Input 3 float values.
const char*
Widget label
float[3]
Array of 3 floats
const char*
default:"%.3f"
Display format
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

InputFloat4

Input 4 float values.
const char*
Widget label
float[4]
Array of 4 floats
const char*
default:"%.3f"
Display format
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

InputInt

Input an integer value.
const char*
Widget label
int*
Pointer to int value
int
default:"1"
Step size for +/- buttons
int
default:"100"
Fast step size (when holding Shift)
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

InputInt2

Input 2 integer values.

InputInt3

Input 3 integer values.

InputInt4

Input 4 integer values.

InputDouble

Input a double value.
const char*
Widget label
double*
Pointer to double value
double
default:"0.0"
Step size for +/- buttons
double
default:"0.0"
Fast step size
const char*
default:"%.6f"
Display format
ImGuiInputTextFlags
default:"0"
Input flags
bool
True when value has been modified

Input Text Flags

ImGuiInputTextFlags_

Flags for InputText(), InputTextMultiline() functions.

Basic Filters

Input Behavior

Options

Callbacks