Removing WinR (#2381)

This commit is contained in:
Clint Rutkas 2020-04-24 11:10:40 -07:00 committed by GitHub
parent 08a7394c1b
commit 368640b59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 16 deletions

View File

@ -289,21 +289,24 @@ namespace Wox.Plugin.Shell
bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
{
if (_settings.ReplaceWinR)
{
if (keyevent == (int)KeyEvent.WM_KEYDOWN && vkcode == (int)Keys.R && state.WinPressed)
{
_winRStroked = true;
OnWinRPressed();
return false;
}
if (keyevent == (int)KeyEvent.WM_KEYUP && _winRStroked && vkcode == (int)Keys.LWin)
{
_winRStroked = false;
_keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.BACK);
return false;
}
}
// not overriding Win+R
// crutkas we need to earn the right for Win+R override
//if (_settings.ReplaceWinR)
//{
// if (keyevent == (int)KeyEvent.WM_KEYDOWN && vkcode == (int)Keys.R && state.WinPressed)
// {
// _winRStroked = true;
// OnWinRPressed();
// return false;
// }
// if (keyevent == (int)KeyEvent.WM_KEYUP && _winRStroked && vkcode == (int)Keys.LWin)
// {
// _winRStroked = false;
// _keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.BACK);
// return false;
// }
//}
return true;
}

View File

@ -5,7 +5,10 @@ namespace Wox.Plugin.Shell
public class Settings
{
public Shell Shell { get; set; } = Shell.RunCommand;
public bool ReplaceWinR { get; set; } = true;
// not overriding Win+R
// crutkas we need to earn the right for Win+R override
public bool ReplaceWinR { get; set; } = false;
public bool LeaveShellOpen { get; set; }
public bool RunAsAdministrator { get; set; } = false;