From 3ce9dbb27861cc15f19d9a8e715c1cdea2d23da4 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 16 Jun 2024 14:59:44 +0200 Subject: [PATCH] fix: Alt and Ctrl being swapped in the text editor on macOS --- .../imgui/ColorTextEditor/source/TextEditor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp index 6ceb3387f..bc91a8a98 100644 --- a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp +++ b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp @@ -623,13 +623,18 @@ ImU32 TextEditor::GetGlyphColor(const Glyph &aGlyph) const { void TextEditor::HandleKeyboardInputs() { ImGuiIO &io = ImGui::GetIO(); + + // command => Ctrl + // control => Super + // option => Alt + auto shift = io.KeyShift; auto left = ImGui::IsKeyPressed(ImGuiKey_LeftArrow); auto right = ImGui::IsKeyPressed(ImGuiKey_RightArrow); auto up = ImGui::IsKeyPressed(ImGuiKey_UpArrow); auto down = ImGui::IsKeyPressed(ImGuiKey_DownArrow); - auto ctrl = io.ConfigMacOSXBehaviors ? io.KeyAlt : io.KeyCtrl; - auto alt = io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeyAlt; + auto ctrl = io.KeyCtrl; + auto alt = io.KeyAlt; auto home = io.ConfigMacOSXBehaviors ? io.KeySuper && left : ImGui::IsKeyPressed(ImGuiKey_Home); auto end = io.ConfigMacOSXBehaviors ? io.KeySuper && right : ImGui::IsKeyPressed(ImGuiKey_End); auto top = io.ConfigMacOSXBehaviors ? io.KeySuper && up : ctrl && ImGui::IsKeyPressed(ImGuiKey_Home);