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:
Boris Makogonyuk
2015-10-08 00:17:37 +02:00
parent 92ddf2ca41
commit 7273e1218a
9 changed files with 56 additions and 2 deletions

View File

@@ -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;
}