Skip to content

Commit

Permalink
Switch flag for ImGui MacOS behaviors (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez authored Jan 20, 2025
1 parent 82a3406 commit 2e7d1fe
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/window/gui/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,21 +499,13 @@ void Gui::DrawMenu() {
}
}

#if __APPLE__
if ((ImGui::IsKeyDown(ImGuiKey_LeftSuper) || ImGui::IsKeyDown(ImGuiKey_RightSuper)) &&
ImGui::IsKeyPressed(ImGuiKey_R, false)) {
std::reinterpret_pointer_cast<ConsoleWindow>(
Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
->Dispatch("reset");
}
#else
// Mac interprets this as cmd+r when io.ConfigMacOSXBehavior is on (on by default)
if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
ImGui::IsKeyPressed(ImGuiKey_R, false)) {
std::reinterpret_pointer_cast<ConsoleWindow>(
Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
->Dispatch("reset");
}
#endif

if (GetMenuBar()) {
GetMenuBar()->Update();
Expand Down

0 comments on commit 2e7d1fe

Please sign in to comment.