[KBM] Fix remaps to arrow keys/Home/Ins, etc not working with Windows Terminal (#7143)

* Added MapVirtualKey call to set scancode before calling SendInput

* Updated comment

* Update comment with link

* Added test for dummy key scan code
This commit is contained in:
Arjun Balgovind
2020-10-08 17:52:19 -07:00
committed by GitHub
parent 1390b57d3e
commit c393db0b65
2 changed files with 18 additions and 0 deletions

View File

@@ -41,5 +41,19 @@ namespace RemappingLogicTests
Assert::AreEqual(true, bool(input[i].ki.dwFlags & KEYEVENTF_EXTENDEDKEY));
}
}
// Test if SetKeyEvent sets the scan code field to 0 for dummy key
TEST_METHOD (SetKeyEvent_ShouldSetScanCodeFieldTo0_WhenArgumentIsDummyKey)
{
const int nInputs = KeyboardManagerConstants::DUMMY_KEY_EVENT_SIZE;
INPUT input[nInputs] = {};
int index = 0;
KeyboardManagerHelper::SetDummyKeyEvent(input, index, 0);
// Assert that wScan for both inputs is 0
Assert::AreEqual<unsigned int>(0, input[0].ki.wScan);
Assert::AreEqual<unsigned int>(0, input[1].ki.wScan);
}
};
}