mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Fix remapping issues to Home/PgUp and other keys which are also present on NumPad (#4398)
* Added extended key flag to more keys * Add test for extended key flag * Move shlwapi.lib reference * Added shcore ref * Fixed pipeline incompatibility * Fixed lib declaration in common * Fixed formatting * Remove unused statements * removed another statement
This commit is contained in:
@@ -45,6 +45,34 @@ namespace KeyboardManagerRemapLogicTests
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CLASS (SetKeyEventTests)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD_INITIALIZE(InitializeTestEnv)
|
||||
{
|
||||
// Reset test environment
|
||||
TestHelpers::ResetTestEnv(mockedInputHandler, testState);
|
||||
}
|
||||
|
||||
// Test if SetKeyEvent sets the extended key flag for all the extended keys
|
||||
TEST_METHOD (SetKeyEvent_ShouldUseExtendedKeyFlag_WhenArgumentIsExtendedKey)
|
||||
{
|
||||
const int nInputs = 15;
|
||||
INPUT input[nInputs] = {};
|
||||
|
||||
// List of extended keys
|
||||
WORD keyCodes[nInputs] = { VK_RCONTROL, VK_RMENU, VK_NUMLOCK, VK_SNAPSHOT, VK_CANCEL, VK_INSERT, VK_HOME, VK_PRIOR, VK_DELETE, VK_END, VK_NEXT, VK_LEFT, VK_DOWN, VK_RIGHT, VK_UP };
|
||||
|
||||
for (int i = 0; i < nInputs; i++)
|
||||
{
|
||||
// Set key events for all the extended keys
|
||||
KeyboardManagerHelper::SetKeyEvent(input, i, INPUT_KEYBOARD, keyCodes[i], 0, 0);
|
||||
// Extended key flag should be set
|
||||
Assert::AreEqual(true, bool(input[i].ki.dwFlags & KEYEVENTF_EXTENDEDKEY));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CLASS (SingleKeyRemappingTests)
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user