1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 09:30:56 +01:00

Nav: Comments, tweaks

This commit is contained in:
omar 2018-01-23 16:45:46 +01:00
parent 9edf211c0e
commit 13c407591e
2 changed files with 8 additions and 4 deletions

View File

@ -2020,10 +2020,10 @@ ImGuiID ImGui::GetActiveID()
void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window) void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
{ {
IM_ASSERT(id != 0);
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
IM_ASSERT(id != 0);
// Assume that SetActiveID() is called in the context where its NavLayer is the current layer, which is the case everywhere we call it. // Assume that SetFocusID() is called in the context where its NavLayer is the current layer, which is the case everywhere we call it.
const int nav_layer = window->DC.NavLayerCurrent; const int nav_layer = window->DC.NavLayerCurrent;
g.NavId = id; g.NavId = id;
g.NavWindow = window; g.NavWindow = window;

View File

@ -698,6 +698,7 @@ enum ImGuiKey_
// Your code passing analog gamepad values is likely to want to transform your raw inputs, using a dead-zone and maybe a power curve. // Your code passing analog gamepad values is likely to want to transform your raw inputs, using a dead-zone and maybe a power curve.
enum ImGuiNavInput_ enum ImGuiNavInput_
{ {
// Gamepad Mapping
ImGuiNavInput_PadActivate, // press button, tweak value // e.g. Circle button ImGuiNavInput_PadActivate, // press button, tweak value // e.g. Circle button
ImGuiNavInput_PadCancel, // close menu/popup/child, lose selection // e.g. Cross button ImGuiNavInput_PadCancel, // close menu/popup/child, lose selection // e.g. Cross button
ImGuiNavInput_PadInput, // text input // e.g. Triangle button ImGuiNavInput_PadInput, // text input // e.g. Triangle button
@ -714,6 +715,8 @@ enum ImGuiNavInput_
ImGuiNavInput_PadFocusNext, // prev window (with PadMenu held) // e.g. R-trigger ImGuiNavInput_PadFocusNext, // prev window (with PadMenu held) // e.g. R-trigger
ImGuiNavInput_PadTweakSlow, // slower tweaks // e.g. L-trigger, analog ImGuiNavInput_PadTweakSlow, // slower tweaks // e.g. L-trigger, analog
ImGuiNavInput_PadTweakFast, // faster tweaks // e.g. R-trigger, analog ImGuiNavInput_PadTweakFast, // faster tweaks // e.g. R-trigger, analog
// Keyboard Mapping
// [BETA] You can use gamepad mapping for most inputs
ImGuiNavInput_KeyMenu, // access menu // e.g. ALT ImGuiNavInput_KeyMenu, // access menu // e.g. ALT
ImGuiNavInput_COUNT, ImGuiNavInput_COUNT,
}; };
@ -920,7 +923,6 @@ struct ImGuiIO
int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state.
float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds. float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
bool NavMovesMouse; // = false // Directional navigation can move the mouse cursor. Updates MousePos and set WantMoveMouse=true. If enabled you MUST honor those requests in your binding, otherwise ImGui will react as if mouse is jumping around.
void* UserData; // = NULL // Store your own data for retrieval by callbacks. void* UserData; // = NULL // Store your own data for retrieval by callbacks.
ImFontAtlas* Fonts; // <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array. ImFontAtlas* Fonts; // <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
@ -931,6 +933,8 @@ struct ImGuiIO
ImVec2 DisplayVisibleMin; // <unset> (0.0f,0.0f) // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area. ImVec2 DisplayVisibleMin; // <unset> (0.0f,0.0f) // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area.
ImVec2 DisplayVisibleMax; // <unset> (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize ImVec2 DisplayVisibleMax; // <unset> (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize
// Gamepad/Keyboard Navigation
bool NavMovesMouse; // = false // Directional navigation can move the mouse cursor. Updates MousePos and set WantMoveMouse=true. If enabled you MUST honor those requests in your binding, otherwise ImGui will react as if mouse is jumping around.
// Advanced/subtle behaviors // Advanced/subtle behaviors
bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl bool OptMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl
bool OptCursorBlink; // = true // Enable blinking cursor, for users who consider it annoying. bool OptCursorBlink; // = true // Enable blinking cursor, for users who consider it annoying.