From 2cf036ec7fb5a4ef1091d5438f28d63446cce975 Mon Sep 17 00:00:00 2001 From: Igor Leonovich <8408481+igorleonovich@users.noreply.github.com> Date: Fri, 19 Dec 2025 00:53:55 +0100 Subject: [PATCH] ui: Remove legacy macOS-specific shortcut handling Ctrl/Cmd mapping on macOS is now handled internally by Dear ImGui --- ui/xui/misc.hh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/xui/misc.hh b/ui/xui/misc.hh index c9983e98bc..904f8c5b8a 100644 --- a/ui/xui/misc.hh +++ b/ui/xui/misc.hh @@ -55,12 +55,15 @@ std::string string_format( const std::string& format, Args ... args ) return std::string( buf.get(), buf.get() + size - 1 ); // We don't want the '\0' inside } -static inline bool IsShortcutKeyPressed(int scancode) +static inline bool IsShortcutKeyPressed(ImGuiKey key) { 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((enum ImGuiKey)scancode); + + if (io.KeyAlt || io.KeyShift) { + return false; + } + + return io.KeyCtrl && ImGui::IsKeyPressed(key); } static inline float mix(float a, float b, float t)