mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[KBM] Do not register low level hook if there're no remappings (#29708)
* [KBM] Do not register low level hook if there're no remappings * f: typo * f: address review comment
This commit is contained in:
@@ -61,9 +61,14 @@ int WINAPI wWinMain(_In_ HINSTANCE /*hInstance*/,
|
||||
}
|
||||
|
||||
auto kbm = KeyboardManager();
|
||||
kbm.StartLowlevelKeyboardHook();
|
||||
if (kbm.HasRegisteredRemappings())
|
||||
kbm.StartLowlevelKeyboardHook();
|
||||
|
||||
run_message_loop();
|
||||
auto StartHookFunc = [&kbm]() {
|
||||
kbm.StartLowlevelKeyboardHook();
|
||||
};
|
||||
|
||||
run_message_loop({}, {}, { { KeyboardManager::StartHookMessageID, StartHookFunc } });
|
||||
|
||||
kbm.StopLowlevelKeyboardHook();
|
||||
Trace::UnregisterProvider();
|
||||
|
||||
Reference in New Issue
Block a user