[MWB]Fix keyboard hook capturing shortcuts with unneeded modifier keys (#26763)

* Fixing keyboard hook eagerness. capture ctrl+alt keys only if shift and win are NOT pressed.

* Update src/modules/MouseWithoutBorders/App/Class/InputHook.cs
This commit is contained in:
Laszlo Nemeth
2023-06-13 16:39:45 +02:00
committed by GitHub
parent 40ef76a686
commit a780e6ae72

View File

@@ -561,6 +561,13 @@ namespace MouseWithoutBorders.Class
Common.MainForm.Quit(false, false);
});
}
else if (shiftDown || winDown)
{
// The following else cases should work if control and alt modifiers are pressed. The hotkeys should still be captured.
// But if any of the other 2 modifiers (shift or win) are pressed, they hotkeys should not be activated.
// Issue #26597
return true;
}
else if (vkCode == Setting.Values.HotKeySwitchMachine ||
vkCode == Setting.Values.HotKeySwitchMachine + 1 ||
vkCode == Setting.Values.HotKeySwitchMachine + 2 ||