From a780e6ae7240ec921136972236f51db1397ab47f Mon Sep 17 00:00:00 2001 From: Laszlo Nemeth <57342539+donlaci@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:39:45 +0200 Subject: [PATCH] [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 --- src/modules/MouseWithoutBorders/App/Class/InputHook.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/MouseWithoutBorders/App/Class/InputHook.cs b/src/modules/MouseWithoutBorders/App/Class/InputHook.cs index 7adac6b0ac..87a1068cb0 100644 --- a/src/modules/MouseWithoutBorders/App/Class/InputHook.cs +++ b/src/modules/MouseWithoutBorders/App/Class/InputHook.cs @@ -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 ||