Change behavior on Edit Keyboard screen to be physical keys (#2666)

* Commented out ToggleToMod and AppSpecific function calls

* Added logic to make sure key remaps don't occur on Edit Keyboard Window

* Changed behavior such that remappings only apply after window is closed
This commit is contained in:
Arjun Balgovind
2020-05-04 15:49:37 -07:00
committed by GitHub
parent 855f3d74fe
commit c4f884f104
8 changed files with 82 additions and 28 deletions

View File

@@ -146,6 +146,9 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
// Vector to store dynamically allocated control objects to avoid early destruction
std::vector<std::vector<std::unique_ptr<ShortcutControl>>> keyboardRemapControlObjects;
// Set keyboard manager UI state so that shortcut remaps are not applied while on this window
keyboardManagerState.SetUIState(KeyboardManagerUIState::EditShortcutsWindowActivated, _hWndEditShortcutsWindow);
// Load existing shortcuts into UI
std::unique_lock<std::mutex> lock(keyboardManagerState.osLevelShortcutReMap_mutex);
for (const auto& it : keyboardManagerState.osLevelShortcutReMap)
@@ -252,6 +255,7 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
hWndXamlIslandEditShortcutsWindow = nullptr;
hwndLock.lock();
hwndEditShortcutsNativeWindow = nullptr;
keyboardManagerState.ResetUIState();
// Cannot be done in WM_DESTROY because that causes crashes due to fatal app exit
xamlBridge.ClearXamlIslands();