From afbb7243fb2128c11e526ab226e6874d42f4ca71 Mon Sep 17 00:00:00 2001 From: Jacob Poteet <64765148+JacobPoteet@users.noreply.github.com> Date: Sat, 10 Feb 2024 16:29:29 -0500 Subject: [PATCH] Revert unrelated optimization --- .../Common/KeyboardShortcutManager.cs | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/src/Calculator/Common/KeyboardShortcutManager.cs b/src/Calculator/Common/KeyboardShortcutManager.cs index c3fe992d..141298bb 100644 --- a/src/Calculator/Common/KeyboardShortcutManager.cs +++ b/src/Calculator/Common/KeyboardShortcutManager.cs @@ -747,17 +747,48 @@ namespace CalculatorApp { int viewId = Utilities.GetWindowId(); - if (controlKeyPressed && !altPressed) + if (controlKeyPressed) { - return shiftKeyPressed ? s_VirtualKeyControlShiftChordsForButtons[viewId] : s_VirtualKeyControlChordsForButtons[viewId]; - } - else if (altPressed && !controlKeyPressed) - { - return shiftKeyPressed ? null : s_VirtualKeyAltChordsForButtons[viewId]; + if (altPressed) + { + return null; + } + else + { + if (shiftKeyPressed) + { + return s_VirtualKeyControlShiftChordsForButtons[viewId]; + } + else + { + return s_VirtualKeyControlChordsForButtons[viewId]; + } + } } else { - return shiftKeyPressed ? s_VirtualKeyShiftChordsForButtons[viewId] : s_virtualKey[viewId]; + if (altPressed) + { + if (shiftKeyPressed) + { + return null; + } + else + { + return s_VirtualKeyAltChordsForButtons[viewId]; + } + } + else + { + if (shiftKeyPressed) + { + return s_VirtualKeyShiftChordsForButtons[viewId]; + } + else + { + return s_virtualKey[viewId]; + } + } } }