Overview
TheImGuiIO structure is the main configuration and I/O interface between your application and Dear ImGui. It contains:
- Configuration options and flags
- Input state (mouse, keyboard, gamepad)
- Output flags (WantCaptureMouse, WantCaptureKeyboard, etc.)
- Time and framerate information
Getting ImGuiIO
Configuration Fields
Display Configuration
ImVec2
Main display size in pixels. May change every frame.
ImVec2
default:"(1, 1)"
For retina displays where window coordinates differ from framebuffer coordinates. Affects font density.
float
default:"1.0f/60.0f"
Time elapsed since last frame, in seconds. May change every frame.
Configuration Flags
ImGuiConfigFlags
default:"0"
See
ImGuiConfigFlags_ enum. Set by user/application.ImGuiBackendFlags
default:"0"
See
ImGuiBackendFlags_ enum. Set by backend to communicate features supported.Font Configuration
ImFontAtlas*
Font atlas: load, rasterize and pack fonts into a single texture.
ImFont*
default:"NULL"
Font to use on NewFrame(). NULL uses Fonts->Fonts[0].
bool
default:"false"
Allow user scaling text with Ctrl+Wheel.
File Paths
const char*
default:"imgui.ini"
Path to .ini file for saving/loading settings. Set NULL to disable.
const char*
default:"imgui_log.txt"
Path to .log file (default for LogToFile when no file specified).
Timing Configuration
float
default:"5.0f"
Minimum time between saving positions/sizes to .ini file, in seconds.
float
default:"0.30f"
Time for a double-click, in seconds.
float
default:"6.0f"
Distance threshold to stay in to validate a double-click, in pixels.
float
default:"6.0f"
Distance threshold before considering we are dragging.
float
default:"0.275f"
When holding a key/button, time before it starts repeating, in seconds.
float
default:"0.050f"
When holding a key/button, rate at which it repeats, in seconds.
Navigation Configuration
Swap Activate/Cancel (A/B) buttons, matching Nintendo/Japanese style.
Directional/tabbing navigation teleports the mouse cursor.
Sets io.WantCaptureKeyboard when io.NavActive is set.
Pressing Escape can clear focused item + navigation.
Using directional navigation key makes the cursor visible.
Miscellaneous Configuration
bool
default:"false"
Request ImGui to draw a mouse cursor for you (software cursor).
bool
default:"defined(__APPLE__)"
Swap Cmd/Ctrl keys + OS X style text editing, etc.
bool
default:"true"
Enable blinking cursor in InputText.
bool
default:"false"
[BETA] Pressing Enter keeps item active and selects contents.
bool
default:"false"
[BETA] Enable turning DragXXX widgets into text input with a simple click-release.
bool
default:"true"
Enable resizing windows from their edges and lower-left corner.
bool
default:"false"
Only allow moving windows when clicking on their title bar.
float
default:"60.0f"
Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
Output Flags
bool
Set when Dear ImGui will use mouse inputs. Don’t dispatch mouse to your game when true.
bool
Set when Dear ImGui will use keyboard inputs. Don’t dispatch keyboard to your game when true.
bool
Mobile/console: when set, you may display an on-screen keyboard.
bool
MousePos has been altered, backend should reposition mouse. Rarely used!
bool
When manual .ini save is active (io.IniFilename == NULL), this notifies you to save. Clear this flag yourself after saving!
Keyboard/Gamepad navigation is currently allowed.
Keyboard/Gamepad navigation highlight is visible and allowed.
float
Estimate of application framerate (rolling average), in frames per second.
Input State
Backends should use
AddXXXEvent() functions to submit input. These fields are maintained by ImGui.Mouse State
ImVec2
Mouse position in pixels. Set to
ImVec2(-FLT_MAX, -FLT_MAX) if unavailable.bool[5]
Mouse buttons state (0=left, 1=right, 2=middle + extras).
float
Mouse wheel vertical: 1 unit scrolls about 5 lines.
float
Mouse wheel horizontal.
ImGuiMouseSource
Mouse actual input peripheral (Mouse/TouchScreen/Pen).
Keyboard State
bool
Keyboard modifier down: Ctrl (non-macOS), Cmd (macOS).
bool
Keyboard modifier down: Shift.
bool
Keyboard modifier down: Alt.
bool
Keyboard modifier down: Windows/Super (non-macOS), Ctrl (macOS).
ImGuiKeyChord
Combined key modifiers flags (updated by NewFrame()).
ImGuiKeyData[ImGuiKey_NamedKey_COUNT]
Key state for all known keys. Use
IsKeyXXX() functions to access.Backend Information
const char*
Platform backend name (informational only).
const char*
Renderer backend name (informational only).
void*
User data for platform backend.
void*
User data for renderer backend.
User Data
void*
default:"NULL"
Store your own data.
Metrics
int
Vertices output during last call to Render().
int
Indices output during last call to Render().
int
Number of visible windows.
int
Number of active windows.
ImVec2
Mouse delta. Zero if either current or previous position are invalid.
Debug Options
bool
default:"true"
Enable error recovery support.
bool
default:"true"
Enable asserts on recoverable errors.
bool
default:"true"
Enable debug log output on recoverable errors.
bool
default:"true"
Enable tooltip on recoverable errors.
bool
default:"false"
Enable various tools calling IM_DEBUG_BREAK().
bool
default:"true"
Highlight and show error when multiple items have conflicting identifiers.
bool
default:"false"
First-time calls to Begin()/BeginChild() will return false.
bool
default:"false"
Some calls to Begin()/BeginChild() will return false, cycling through window depths.
See Also
- Input - Input event functions
- Keyboard - Keyboard input
- Mouse - Mouse input
- ImGuiPlatformIO - Platform-specific functions