- When keyboard navigation is active (io.NavActive + ImGuiConfigFlags_NavEnableKeyboard), the io.WantCaptureKeyboard flag will be set.
For more advanced uses, you may want to read from io.NavActive or io.NavVisible. Read imgui.cpp for more details.
- To use Gamepad Navigation:
- Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
- Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
- Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
- See https://github.com/ocornut/imgui/issues/1599 for recommended gamepad mapping.
- See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. Read imgui.cpp for more details.
- Navigation: SetItemDefaultFocus() sets the navigation position in addition to scrolling. (#787)
// Start the frame. This call will update the io.WantCaptureMouse, io.WantCaptureKeyboard flag that you can use to dispatch inputs (or not) to your application.
@ -91,6 +91,7 @@ typedef int ImGuiStyleVar; // enum: a variable identifier for styling
typedefintImDrawCornerFlags;// flags: for ImDrawList::AddRect*() etc. // enum ImDrawCornerFlags_
typedefintImDrawListFlags;// flags: for ImDrawList // enum ImDrawListFlags_
typedefintImFontAtlasFlags;// flags: for ImFontAtlas // enum ImFontAtlasFlags_
typedefintImGuiBackendFlags;// flags: for io.BackendFlags // enum ImGuiBackendFlags_
typedefintImGuiColorEditFlags;// flags: for ColorEdit*(), ColorPicker*() // enum ImGuiColorEditFlags_
typedefintImGuiColumnsFlags;// flags: for *Columns*() // enum ImGuiColumnsFlags_
typedefintImGuiConfigFlags;// flags: for io.ConfigFlags // enum ImGuiConfigFlags_
@ -736,7 +737,7 @@ enum ImGuiKey_
// [BETA] Gamepad/Keyboard directional navigation
// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeyDown[] + io.KeyMap[] arrays.
// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Back-end: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
// Read instructions in imgui.cpp for more details. Download PNG/PSD at goo.gl/9LgVZW.
// Configuration flags stored in io.ConfigFlags. Set by user/application.
enumImGuiConfigFlags_
{
ImGuiConfigFlags_NavEnableKeyboard=1<<0,// Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeyDown[].
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[].
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NavEnableSetMousePos=1<<2,// Request navigation to allow moving the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth.
ImGuiConfigFlags_NavNoCaptureKeyboard=1<<3,// Do not set the io.WantCaptureKeyboard flag with io.NavActive is set.
// User storage (to allow your back-end/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core ImGui)
ImGuiConfigFlags_IsSRGB=1<<20,// Back-end is SRGB-aware.
ImGuiConfigFlags_IsTouchScreen=1<<21// Back-end is using a touch screen instead of a mouse.
ImGuiConfigFlags_IsSRGB=1<<20,// Application is SRGB-aware.
ImGuiConfigFlags_IsTouchScreen=1<<21// Application is using a touch screen instead of a mouse.
};
// Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end.
enumImGuiBackendFlags_
{
ImGuiBackendFlags_HasGamepad=1<<0// Back-end has a connected gamepad
};
// Enumeration for PushStyleColor() / PopStyleColor()