diff --git a/ui/xui/main-menu.cc b/ui/xui/main-menu.cc index 2940d10760..34e6904860 100644 --- a/ui/xui/main-menu.cc +++ b/ui/xui/main-menu.cc @@ -1257,8 +1257,8 @@ void MainMenuScene::HandleInput() // XXX: Ensure we have focus for two frames. If a user cancels a popup window, we do not want to cancel main // window as well. if (nofocus || (focus && m_had_focus_last_frame && - ImGui::IsNavInputTest(ImGuiNavInput_Cancel, - ImGuiInputReadMode_Pressed))) { + (ImGui::IsKeyDown(ImGuiKey_GamepadFaceRight) + || ImGui::IsKeyDown(ImGuiKey_Escape)))) { Hide(); return; } diff --git a/ui/xui/main.cc b/ui/xui/main.cc index 4680dad29b..c7d00f33ba 100644 --- a/ui/xui/main.cc +++ b/ui/xui/main.cc @@ -284,7 +284,7 @@ void xemu_hud_render(void) bool mod_key_down = ImGui::IsKeyDown(ImGuiKey_ModShift); for (int f_key = 0; f_key < 4; ++f_key) { - if (ImGui::IsKeyPressed(f_key + ImGuiKey_F5)) { + if (ImGui::IsKeyPressed((enum ImGuiKey)(ImGuiKey_F5 + f_key))) { ActionActivateBoundSnapshot(f_key, mod_key_down); break; } diff --git a/ui/xui/misc.hh b/ui/xui/misc.hh index 0a31ed4a8c..c9983e98bc 100644 --- a/ui/xui/misc.hh +++ b/ui/xui/misc.hh @@ -28,13 +28,6 @@ extern "C" { #include } -static inline -bool IsNavInputPressed(ImGuiNavInput i) { - ImGuiIO &io = ImGui::GetIO(); - return io.NavInputs[i] > 0.0f && io.NavInputsDownDuration[i] == 0.0f; -} - - static inline const char *PausedFileOpen(int flags, const char *filters, const char *default_path, const char *default_name) @@ -67,7 +60,7 @@ static inline bool IsShortcutKeyPressed(int scancode) ImGuiIO& io = ImGui::GetIO(); const bool is_osx = io.ConfigMacOSXBehaviors; const bool is_shortcut_key = (is_osx ? (io.KeySuper && !io.KeyCtrl) : (io.KeyCtrl && !io.KeySuper)) && !io.KeyAlt && !io.KeyShift; // OS X style: Shortcuts using Cmd/Super instead of Ctrl - return is_shortcut_key && ImGui::IsKeyPressed(scancode); + return is_shortcut_key && ImGui::IsKeyPressed((enum ImGuiKey)scancode); } static inline float mix(float a, float b, float t) diff --git a/ui/xui/popup-menu.cc b/ui/xui/popup-menu.cc index dcaf5e9b94..82ae785137 100644 --- a/ui/xui/popup-menu.cc +++ b/ui/xui/popup-menu.cc @@ -459,9 +459,9 @@ void PopupMenuScene::PopFocus() m_focus_stack.pop_back(); ImGuiContext *g = ImGui::GetCurrentContext(); g->NavInitRequest = false; - g->NavInitResultId = next_focus.first; - g->NavInitResultRectRel = ImGui::WindowRectAbsToRel(g->CurrentWindow, - next_focus.second); + g->NavInitResult.ID = next_focus.first; + g->NavInitResult.RectRel = ImGui::WindowRectAbsToRel(g->CurrentWindow, + next_focus.second); // ImGui::NavUpdateAnyRequestFlag(); g->NavAnyRequest = g->NavMoveScoringItems || g->NavInitRequest;// || (IMGUI_DEBUG_NAV_SCORING && g->NavWindow != NULL); } @@ -480,7 +480,8 @@ void PopupMenuScene::ClearMenuStack() void PopupMenuScene::HandleInput() { - if (IsNavInputPressed(ImGuiNavInput_Cancel)) { + if (ImGui::IsKeyPressed(ImGuiKey_GamepadFaceRight, false) + || ImGui::IsKeyPressed(ImGuiKey_Escape, false)) { PopMenu(); } }