1
0
mirror of synced 2025-01-19 01:24:15 +01:00

fix: Alt and Ctrl being swapped in the text editor on macOS

This commit is contained in:
WerWolv 2024-06-16 14:59:44 +02:00
parent bee4b906fb
commit 3ce9dbb278

View File

@ -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);