Add workaround for IME Caps Lock issue (#4123)

* Add workaround for Japanese IME Caps Lock issue

* Changed tweak to reset modifier key rather than Caps Lock

* added tests

* Fixed test comment

* Moved environment initialization in KBM tests to TEST_METHOD_INITIALIZE
This commit is contained in:
Arjun Balgovind
2020-06-15 16:48:00 -07:00
committed by GitHub
parent f8cc129f04
commit 49cbcf01c6
6 changed files with 131 additions and 189 deletions

View File

@@ -15,6 +15,10 @@ private:
// Function to be executed as a low level hook. By default it is nullptr so the hook is skipped
std::function<intptr_t(LowlevelKeyboardEvent*)> hookProc;
// Stores the count of sendVirtualInput calls given if the condition sendVirtualInputCallCondition is satisfied
int sendVirtualInputCallCount = 0;
std::function<bool(LowlevelKeyboardEvent*)> sendVirtualInputCallCondition;
public:
MockedInput()
{
@@ -35,4 +39,10 @@ public:
// Function to reset the mocked keyboard state
void ResetKeyboardState();
// Function to set SendVirtualInput call count condition
void SetSendVirtualInputTestHandler(std::function<bool(LowlevelKeyboardEvent*)> condition);
// Function to get SendVirtualInput call count
int GetSendVirtualInputCallCount();
};