diff --git a/src/Calculator/Common/KeyboardShortcutManager.cs b/src/Calculator/Common/KeyboardShortcutManager.cs index 141298bb..c3fe992d 100644 --- a/src/Calculator/Common/KeyboardShortcutManager.cs +++ b/src/Calculator/Common/KeyboardShortcutManager.cs @@ -747,48 +747,17 @@ namespace CalculatorApp { int viewId = Utilities.GetWindowId(); - if (controlKeyPressed) + if (controlKeyPressed && !altPressed) { - if (altPressed) - { - return null; - } - else - { - if (shiftKeyPressed) - { - return s_VirtualKeyControlShiftChordsForButtons[viewId]; - } - else - { - return s_VirtualKeyControlChordsForButtons[viewId]; - } - } + return shiftKeyPressed ? s_VirtualKeyControlShiftChordsForButtons[viewId] : s_VirtualKeyControlChordsForButtons[viewId]; + } + else if (altPressed && !controlKeyPressed) + { + return shiftKeyPressed ? null : s_VirtualKeyAltChordsForButtons[viewId]; } else { - if (altPressed) - { - if (shiftKeyPressed) - { - return null; - } - else - { - return s_VirtualKeyAltChordsForButtons[viewId]; - } - } - else - { - if (shiftKeyPressed) - { - return s_VirtualKeyShiftChordsForButtons[viewId]; - } - else - { - return s_virtualKey[viewId]; - } - } + return shiftKeyPressed ? s_VirtualKeyShiftChordsForButtons[viewId] : s_virtualKey[viewId]; } }