mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
Removed hook creating from constructor (#4572)
This commit is contained in:
parent
1181ab67ba
commit
f46b876fd6
@ -10,13 +10,6 @@ std::function<void()> SecondaryMouseButtonsHook::callback = {};
|
||||
SecondaryMouseButtonsHook::SecondaryMouseButtonsHook(std::function<void()> extCallback)
|
||||
{
|
||||
callback = std::move(extCallback);
|
||||
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
hHook = SetWindowsHookEx(WH_MOUSE_LL, SecondaryMouseButtonsProc, GetModuleHandle(NULL), 0);
|
||||
}
|
||||
|
||||
void SecondaryMouseButtonsHook::enable()
|
||||
|
@ -11,13 +11,6 @@ std::function<void(bool)> ShiftKeyHook::callback = {};
|
||||
ShiftKeyHook::ShiftKeyHook(std::function<void(bool)> extCallback)
|
||||
{
|
||||
callback = std::move(extCallback);
|
||||
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, ShiftKeyHookProc, GetModuleHandle(NULL), 0);
|
||||
}
|
||||
|
||||
void ShiftKeyHook::enable()
|
||||
|
Loading…
Reference in New Issue
Block a user