mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Wox now has an option to ignore hotkeys when the focused window is topmost. This will ignore not only the main Wox hotkey but also plugin hotkeys.
~ WindowIntelopHelper edited ~ User settings entry added ~ Checkbox added to General tab (as well as its events) ~ Language entries added for en/ru
This commit is contained in:
@@ -356,6 +356,20 @@ namespace Wox
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if Wox should ignore any hotkeys
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool ShouldIgnoreHotkeys()
|
||||
{
|
||||
|
||||
if (!IsVisible
|
||||
&& UserSettingStorage.Instance.IgnoreHotkeysOnTopMostFocus
|
||||
&& WindowIntelopHelper.IsForegroundWindowTopMost())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SetCustomPluginHotkey()
|
||||
{
|
||||
if (UserSettingStorage.Instance.CustomPluginHotkeys == null) return;
|
||||
@@ -364,6 +378,7 @@ namespace Wox
|
||||
CustomPluginHotkey hotkey1 = hotkey;
|
||||
SetHotkey(hotkey.Hotkey, delegate
|
||||
{
|
||||
if (ShouldIgnoreHotkeys()) return;
|
||||
ShowApp();
|
||||
ChangeQuery(hotkey1.ActionKeyword, true);
|
||||
});
|
||||
@@ -372,6 +387,7 @@ namespace Wox
|
||||
|
||||
private void OnHotkey(object sender, HotkeyEventArgs e)
|
||||
{
|
||||
if (ShouldIgnoreHotkeys()) return;
|
||||
ToggleWox();
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user