Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabling WinR #2381

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/modules/launcher/Plugins/Wox.Plugin.Shell/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,21 +289,24 @@ public void Init(PluginInitContext context)

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

Expand Down
5 changes: 4 additions & 1 deletion src/modules/launcher/Plugins/Wox.Plugin.Shell/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down