@ -5395,9 +5395,9 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if ( g . NavWindowingTarget & & g . NavWindowingTarget - > RootWindow = = window )
{
ImVec2 nav_resize_delta ;
if ( g . NavInputSource = = ImGuiInputSource_ Nav Keyboard & & g . IO . KeyShift )
if ( g . NavInputSource = = ImGuiInputSource_ Keyboard & & g . IO . KeyShift )
nav_resize_delta = GetNavInputAmount2d ( ImGuiNavDirSourceFlags_Keyboard , ImGuiInputReadMode_Down ) ;
if ( g . NavInputSource = = ImGuiInputSource_ Nav Gamepad)
if ( g . NavInputSource = = ImGuiInputSource_ Gamepad)
nav_resize_delta = GetNavInputAmount2d ( ImGuiNavDirSourceFlags_PadDPad , ImGuiInputReadMode_Down ) ;
if ( nav_resize_delta . x ! = 0.0f | | nav_resize_delta . y ! = 0.0f )
{
@ -8931,17 +8931,17 @@ static void ImGui::NavUpdate()
// (do it before we map Keyboard input!)
bool nav_keyboard_active = ( io . ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard ) ! = 0 ;
bool nav_gamepad_active = ( io . ConfigFlags & ImGuiConfigFlags_NavEnableGamepad ) ! = 0 & & ( io . BackendFlags & ImGuiBackendFlags_HasGamepad ) ! = 0 ;
if ( nav_gamepad_active & & g . NavInputSource ! = ImGuiInputSource_ Nav Gamepad)
if ( nav_gamepad_active & & g . NavInputSource ! = ImGuiInputSource_ Gamepad)
{
if ( io . NavInputs [ ImGuiNavInput_Activate ] > 0.0f | | io . NavInputs [ ImGuiNavInput_Input ] > 0.0f | | io . NavInputs [ ImGuiNavInput_Cancel ] > 0.0f | | io . NavInputs [ ImGuiNavInput_Menu ] > 0.0f
| | io . NavInputs [ ImGuiNavInput_DpadLeft ] > 0.0f | | io . NavInputs [ ImGuiNavInput_DpadRight ] > 0.0f | | io . NavInputs [ ImGuiNavInput_DpadUp ] > 0.0f | | io . NavInputs [ ImGuiNavInput_DpadDown ] > 0.0f )
g . NavInputSource = ImGuiInputSource_ Nav Gamepad;
g . NavInputSource = ImGuiInputSource_ Gamepad;
}
// Update Keyboard->Nav inputs mapping
if ( nav_keyboard_active )
{
# define NAV_MAP_KEY(_KEY, _NAV_INPUT) do { if (IsKeyDown(io.KeyMap[_KEY])) { io.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_ Nav Keyboard; } } while (0)
# define NAV_MAP_KEY(_KEY, _NAV_INPUT) do { if (IsKeyDown(io.KeyMap[_KEY])) { io.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_ Keyboard; } } while (0)
NAV_MAP_KEY ( ImGuiKey_Space , ImGuiNavInput_Activate ) ;
NAV_MAP_KEY ( ImGuiKey_Enter , ImGuiNavInput_Input ) ;
NAV_MAP_KEY ( ImGuiKey_Escape , ImGuiNavInput_Cancel ) ;
@ -9155,7 +9155,7 @@ static void ImGui::NavUpdate()
// When using gamepad, we project the reference nav bounding box into window visible area.
// This is to allow resuming navigation inside the visible area after doing a large amount of scrolling, since with gamepad every movements are relative
// (can't focus a visible object like we can with the mouse).
if ( g . NavMoveRequest & & g . NavInputSource = = ImGuiInputSource_ Nav Gamepad & & g . NavLayer = = ImGuiNavLayer_Main )
if ( g . NavMoveRequest & & g . NavInputSource = = ImGuiInputSource_ Gamepad & & g . NavLayer = = ImGuiNavLayer_Main )
{
ImGuiWindow * window = g . NavWindow ;
ImRect window_rect_rel ( window - > InnerRect . Min - window - > Pos - ImVec2 ( 1 , 1 ) , window - > InnerRect . Max - window - > Pos + ImVec2 ( 1 , 1 ) ) ;
@ -9471,12 +9471,12 @@ static void ImGui::NavUpdateWindowing()
g . NavWindowingTarget = g . NavWindowingTargetAnim = window - > RootWindow ; // FIXME-DOCK: Will need to use RootWindowDockStop
g . NavWindowingTimer = g . NavWindowingHighlightAlpha = 0.0f ;
g . NavWindowingToggleLayer = start_windowing_with_keyboard ? false : true ;
g . NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_ Nav Keyboard : ImGuiInputSource_ Nav Gamepad;
g . NavInputSource = start_windowing_with_keyboard ? ImGuiInputSource_ Keyboard : ImGuiInputSource_ Gamepad;
}
// Gamepad update
g . NavWindowingTimer + = g . IO . DeltaTime ;
if ( g . NavWindowingTarget & & g . NavInputSource = = ImGuiInputSource_ Nav Gamepad)
if ( g . NavWindowingTarget & & g . NavInputSource = = ImGuiInputSource_ Gamepad)
{
// Highlight only appears after a brief time holding the button, so that a fast tap on PadMenu (to toggle NavLayer) doesn't add visual noise
g . NavWindowingHighlightAlpha = ImMax ( g . NavWindowingHighlightAlpha , ImSaturate ( ( g . NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY ) / 0.05f ) ) ;
@ -9502,7 +9502,7 @@ static void ImGui::NavUpdateWindowing()
}
// Keyboard: Focus
if ( g . NavWindowingTarget & & g . NavInputSource = = ImGuiInputSource_ Nav Keyboard)
if ( g . NavWindowingTarget & & g . NavInputSource = = ImGuiInputSource_ Keyboard)
{
// Visuals only appears after a brief time after pressing TAB the first time, so that a fast CTRL+TAB doesn't add visual noise
g . NavWindowingHighlightAlpha = ImMax ( g . NavWindowingHighlightAlpha , ImSaturate ( ( g . NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY ) / 0.05f ) ) ; // 1.0f
@ -9524,9 +9524,9 @@ static void ImGui::NavUpdateWindowing()
if ( g . NavWindowingTarget & & ! ( g . NavWindowingTarget - > Flags & ImGuiWindowFlags_NoMove ) )
{
ImVec2 move_delta ;
if ( g . NavInputSource = = ImGuiInputSource_ Nav Keyboard & & ! g . IO . KeyShift )
if ( g . NavInputSource = = ImGuiInputSource_ Keyboard & & ! g . IO . KeyShift )
move_delta = GetNavInputAmount2d ( ImGuiNavDirSourceFlags_Keyboard , ImGuiInputReadMode_Down ) ;
if ( g . NavInputSource = = ImGuiInputSource_ Nav Gamepad)
if ( g . NavInputSource = = ImGuiInputSource_ Gamepad)
move_delta = GetNavInputAmount2d ( ImGuiNavDirSourceFlags_PadLStick , ImGuiInputReadMode_Down ) ;
if ( move_delta . x ! = 0.0f | | move_delta . y ! = 0.0f )
{