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
Main display size in pixels. May change every frame.
For retina displays where window coordinates differ from framebuffer coordinates. Affects font density.
Time elapsed since last frame, in seconds. May change every frame.
Configuration Flags
See
ImGuiConfigFlags_ enum. Set by user/application.See
ImGuiBackendFlags_ enum. Set by backend to communicate features supported.Font Configuration
Font atlas: load, rasterize and pack fonts into a single texture.
Font to use on NewFrame(). NULL uses Fonts->Fonts[0].
Allow user scaling text with Ctrl+Wheel.
File Paths
Path to .ini file for saving/loading settings. Set NULL to disable.
Path to .log file (default for LogToFile when no file specified).
Timing Configuration
Minimum time between saving positions/sizes to .ini file, in seconds.
Time for a double-click, in seconds.
Distance threshold to stay in to validate a double-click, in pixels.
Distance threshold before considering we are dragging.
When holding a key/button, time before it starts repeating, in seconds.
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
Request ImGui to draw a mouse cursor for you (software cursor).
Swap Cmd/Ctrl keys + OS X style text editing, etc.
Enable blinking cursor in InputText.
[BETA] Pressing Enter keeps item active and selects contents.
[BETA] Enable turning DragXXX widgets into text input with a simple click-release.
Enable resizing windows from their edges and lower-left corner.
Only allow moving windows when clicking on their title bar.
Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
Output Flags
Set when Dear ImGui will use mouse inputs. Don’t dispatch mouse to your game when true.
Set when Dear ImGui will use keyboard inputs. Don’t dispatch keyboard to your game when true.
Mobile/console: when set, you may display an on-screen keyboard.
MousePos has been altered, backend should reposition mouse. Rarely used!
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.
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
Mouse position in pixels. Set to
ImVec2(-FLT_MAX, -FLT_MAX) if unavailable.Mouse buttons state (0=left, 1=right, 2=middle + extras).
Mouse wheel vertical: 1 unit scrolls about 5 lines.
Mouse wheel horizontal.
Mouse actual input peripheral (Mouse/TouchScreen/Pen).
Keyboard State
Keyboard modifier down: Ctrl (non-macOS), Cmd (macOS).
Keyboard modifier down: Shift.
Keyboard modifier down: Alt.
Keyboard modifier down: Windows/Super (non-macOS), Ctrl (macOS).
Combined key modifiers flags (updated by NewFrame()).
Key state for all known keys. Use
IsKeyXXX() functions to access.Backend Information
Platform backend name (informational only).
Renderer backend name (informational only).
User data for platform backend.
User data for renderer backend.
User Data
Store your own data.
Metrics
Vertices output during last call to Render().
Indices output during last call to Render().
Number of visible windows.
Number of active windows.
Mouse delta. Zero if either current or previous position are invalid.
Debug Options
Enable error recovery support.
Enable asserts on recoverable errors.
Enable debug log output on recoverable errors.
Enable tooltip on recoverable errors.
Enable various tools calling IM_DEBUG_BREAK().
Highlight and show error when multiple items have conflicting identifiers.
First-time calls to Begin()/BeginChild() will return 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