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

@@ -19,8 +19,12 @@ enum class KeyboardManagerUIState
Deactivated,
// If set to this value then the detect key window is currently active and it requires a hook
DetectSingleKeyRemapWindowActivated,
// If set to this value then the edit keyboard window is currently active and remaps should not be applied
EditKeyboardWindowActivated,
// If set to this value then the detect shortcut window is currently active and it requires a hook
DetectShortcutWindowActivated
DetectShortcutWindowActivated,
// If set to this value then the edit shortcuts window is currently active and remaps should not be applied
EditShortcutsWindowActivated
};
// Class to store the shared state of the keyboard manager between the UI and the hook
@@ -100,7 +104,7 @@ public:
// Function to reset the UI state members
void ResetUIState();
// Function to check the if the UI state matches the argument state. For states with activated windows it also checks if the window is in focus.
// Function to check the if the UI state matches the argument state. For states with detect windows it also checks if the window is in focus.
bool CheckUIState(KeyboardManagerUIState state);
// Function to set the window handle of the current UI window that is activated
@@ -140,10 +144,10 @@ public:
DWORD GetDetectedSingleRemapKey();
// Function which can be used in HandleKeyboardHookEvent before the single key remap event to use the UI and suppress events while the remap window is active.
bool DetectSingleRemapKeyUIBackend(LowlevelKeyboardEvent* data);
KeyboardManagerHelper::KeyboardHookDecision DetectSingleRemapKeyUIBackend(LowlevelKeyboardEvent* data);
// Function which can be used in HandleKeyboardHookEvent before the os level shortcut remap event to use the UI and suppress events while the remap window is active.
bool DetectShortcutUIBackend(LowlevelKeyboardEvent* data);
KeyboardManagerHelper::KeyboardHookDecision DetectShortcutUIBackend(LowlevelKeyboardEvent* data);
// Add a KeyDelay object to get delayed key presses events for a given virtual key
// NOTE: this will throw an exception if a virtual key is registered twice.