mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
Register the hotkey after PT Run is initialized (#11858)
This commit is contained in:
parent
0f32e99d88
commit
d7e09e83c2
@ -138,6 +138,7 @@ namespace PowerLauncher
|
|||||||
bootTime.Stop();
|
bootTime.Stop();
|
||||||
|
|
||||||
Log.Info(textToLog.ToString(), GetType());
|
Log.Info(textToLog.ToString(), GetType());
|
||||||
|
_mainVM.RegisterHotkey();
|
||||||
PowerToysTelemetry.Log.WriteEvent(new LauncherBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
PowerToysTelemetry.Log.WriteEvent(new LauncherBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
||||||
|
|
||||||
// [Conditional("RELEASE")]
|
// [Conditional("RELEASE")]
|
||||||
|
@ -74,8 +74,12 @@ namespace PowerLauncher.ViewModel
|
|||||||
|
|
||||||
InitializeKeyCommands();
|
InitializeKeyCommands();
|
||||||
RegisterResultsUpdatedEvent();
|
RegisterResultsUpdatedEvent();
|
||||||
|
}
|
||||||
|
|
||||||
if (settings != null && settings.UsePowerToysRunnerKeyboardHook)
|
public void RegisterHotkey()
|
||||||
|
{
|
||||||
|
Log.Info("RegisterHotkey()", GetType());
|
||||||
|
if (_settings != null && _settings.UsePowerToysRunnerKeyboardHook)
|
||||||
{
|
{
|
||||||
NativeEventWaiter.WaitForEventLoop(Constants.PowerLauncherSharedEvent(), OnHotkey);
|
NativeEventWaiter.WaitForEventLoop(Constants.PowerLauncherSharedEvent(), OnHotkey);
|
||||||
_hotkeyHandle = 0;
|
_hotkeyHandle = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user