mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 14:41:21 +08:00
fixup! forgot to rename
This commit is contained in:
parent
2effbd0baf
commit
b84ea020f2
@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Prevent system-wide input lagging while paused in the debugger
|
// Prevent system-wide input lagging while paused in the debugger
|
||||||
//#define DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED
|
//#define DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED
|
||||||
|
@ -61,7 +61,7 @@ void KeyboardHook::Start()
|
|||||||
hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc);
|
hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc);
|
||||||
Process ^ curProcess = Process::GetCurrentProcess();
|
Process ^ curProcess = Process::GetCurrentProcess();
|
||||||
ProcessModule ^ curModule = curProcess->MainModule;
|
ProcessModule ^ curModule = curProcess->MainModule;
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
const bool hookDisabled = IsDebuggerPresent();
|
const bool hookDisabled = IsDebuggerPresent();
|
||||||
#else
|
#else
|
||||||
const bool hookDisabled = false;
|
const bool hookDisabled = false;
|
||||||
|
@ -79,7 +79,7 @@ public:
|
|||||||
InitializeWinhookEventIds();
|
InitializeWinhookEventIds();
|
||||||
Trace::FancyZones::EnableFancyZones(true);
|
Trace::FancyZones::EnableFancyZones(true);
|
||||||
m_app = MakeFancyZones(reinterpret_cast<HINSTANCE>(&__ImageBase), m_settings);
|
m_app = MakeFancyZones(reinterpret_cast<HINSTANCE>(&__ImageBase), m_settings);
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
const bool hook_disabled = IsDebuggerPresent();
|
const bool hook_disabled = IsDebuggerPresent();
|
||||||
#else
|
#else
|
||||||
const bool hook_disabled = false;
|
const bool hook_disabled = false;
|
||||||
|
@ -10,7 +10,7 @@ std::function<void()> SecondaryMouseButtonsHook::callback = {};
|
|||||||
SecondaryMouseButtonsHook::SecondaryMouseButtonsHook(std::function<void()> extCallback)
|
SecondaryMouseButtonsHook::SecondaryMouseButtonsHook(std::function<void()> extCallback)
|
||||||
{
|
{
|
||||||
callback = std::move(extCallback);
|
callback = std::move(extCallback);
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -21,7 +21,7 @@ SecondaryMouseButtonsHook::SecondaryMouseButtonsHook(std::function<void()> extCa
|
|||||||
|
|
||||||
void SecondaryMouseButtonsHook::enable()
|
void SecondaryMouseButtonsHook::enable()
|
||||||
{
|
{
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -11,7 +11,7 @@ std::function<void(bool)> ShiftKeyHook::callback = {};
|
|||||||
ShiftKeyHook::ShiftKeyHook(std::function<void(bool)> extCallback)
|
ShiftKeyHook::ShiftKeyHook(std::function<void(bool)> extCallback)
|
||||||
{
|
{
|
||||||
callback = std::move(extCallback);
|
callback = std::move(extCallback);
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -22,7 +22,7 @@ ShiftKeyHook::ShiftKeyHook(std::function<void(bool)> extCallback)
|
|||||||
|
|
||||||
void ShiftKeyHook::enable()
|
void ShiftKeyHook::enable()
|
||||||
{
|
{
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -301,7 +301,7 @@ public:
|
|||||||
|
|
||||||
void start_lowlevel_keyboard_hook()
|
void start_lowlevel_keyboard_hook()
|
||||||
{
|
{
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -135,7 +135,7 @@ void OverlayWindow::enable()
|
|||||||
winkey_popup->set_theme(theme.value);
|
winkey_popup->set_theme(theme.value);
|
||||||
target_state = std::make_unique<TargetState>(pressTime.value);
|
target_state = std::make_unique<TargetState>(pressTime.value);
|
||||||
winkey_popup->initialize();
|
winkey_popup->initialize();
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
const bool hook_disabled = IsDebuggerPresent();
|
const bool hook_disabled = IsDebuggerPresent();
|
||||||
#else
|
#else
|
||||||
const bool hook_disabled = false;
|
const bool hook_disabled = false;
|
||||||
|
@ -25,7 +25,7 @@ namespace
|
|||||||
|
|
||||||
void start_lowlevel_keyboard_hook()
|
void start_lowlevel_keyboard_hook()
|
||||||
{
|
{
|
||||||
#if defined(DISABLE_LOWLEVEL_KBHOOK_WHEN_DEBUGGED)
|
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||||
if (IsDebuggerPresent())
|
if (IsDebuggerPresent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user