fix: Alt and Ctrl being swapped in the text editor on macOS
This commit is contained in:
parent
bee4b906fb
commit
3ce9dbb278
@ -623,13 +623,18 @@ ImU32 TextEditor::GetGlyphColor(const Glyph &aGlyph) const {
|
|||||||
|
|
||||||
void TextEditor::HandleKeyboardInputs() {
|
void TextEditor::HandleKeyboardInputs() {
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
|
||||||
|
// command => Ctrl
|
||||||
|
// control => Super
|
||||||
|
// option => Alt
|
||||||
|
|
||||||
auto shift = io.KeyShift;
|
auto shift = io.KeyShift;
|
||||||
auto left = ImGui::IsKeyPressed(ImGuiKey_LeftArrow);
|
auto left = ImGui::IsKeyPressed(ImGuiKey_LeftArrow);
|
||||||
auto right = ImGui::IsKeyPressed(ImGuiKey_RightArrow);
|
auto right = ImGui::IsKeyPressed(ImGuiKey_RightArrow);
|
||||||
auto up = ImGui::IsKeyPressed(ImGuiKey_UpArrow);
|
auto up = ImGui::IsKeyPressed(ImGuiKey_UpArrow);
|
||||||
auto down = ImGui::IsKeyPressed(ImGuiKey_DownArrow);
|
auto down = ImGui::IsKeyPressed(ImGuiKey_DownArrow);
|
||||||
auto ctrl = io.ConfigMacOSXBehaviors ? io.KeyAlt : io.KeyCtrl;
|
auto ctrl = io.KeyCtrl;
|
||||||
auto alt = io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeyAlt;
|
auto alt = io.KeyAlt;
|
||||||
auto home = io.ConfigMacOSXBehaviors ? io.KeySuper && left : ImGui::IsKeyPressed(ImGuiKey_Home);
|
auto home = io.ConfigMacOSXBehaviors ? io.KeySuper && left : ImGui::IsKeyPressed(ImGuiKey_Home);
|
||||||
auto end = io.ConfigMacOSXBehaviors ? io.KeySuper && right : ImGui::IsKeyPressed(ImGuiKey_End);
|
auto end = io.ConfigMacOSXBehaviors ? io.KeySuper && right : ImGui::IsKeyPressed(ImGuiKey_End);
|
||||||
auto top = io.ConfigMacOSXBehaviors ? io.KeySuper && up : ctrl && ImGui::IsKeyPressed(ImGuiKey_Home);
|
auto top = io.ConfigMacOSXBehaviors ? io.KeySuper && up : ctrl && ImGui::IsKeyPressed(ImGuiKey_Home);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user