fixed #240: Workaround for hotkey Windows modifier support

This commit is contained in:
Jaex 2015-07-21 03:25:38 +03:00
parent 22c32db065
commit 8a011a5611
2 changed files with 20 additions and 18 deletions

View file

@ -128,6 +128,11 @@ private void btnHotkey_KeyDown(object sender, KeyEventArgs e)
Setting.HotkeyInfo.Hotkey = Keys.None; Setting.HotkeyInfo.Hotkey = Keys.None;
StopEditing(); StopEditing();
} }
else if (e.KeyCode == Keys.LWin || e.KeyCode == Keys.RWin)
{
Setting.HotkeyInfo.Win = !Setting.HotkeyInfo.Win;
UpdateHotkeyText();
}
else if (new HotkeyInfo(e.KeyData).IsValidHotkey) else if (new HotkeyInfo(e.KeyData).IsValidHotkey)
{ {
Setting.HotkeyInfo.Hotkey = e.KeyData; Setting.HotkeyInfo.Hotkey = e.KeyData;

View file

@ -101,7 +101,7 @@ public bool IsOnlyModifiers
{ {
get get
{ {
return KeyCode == Keys.ControlKey || KeyCode == Keys.ShiftKey || KeyCode == Keys.Menu; return KeyCode == Keys.ControlKey || KeyCode == Keys.ShiftKey || KeyCode == Keys.Menu || (KeyCode == Keys.None && Win);
} }
} }
@ -134,8 +134,6 @@ public override string ToString()
{ {
string text = string.Empty; string text = string.Empty;
if (KeyCode != Keys.None)
{
if (Control) if (Control)
{ {
text += "Ctrl + "; text += "Ctrl + ";
@ -155,7 +153,6 @@ public override string ToString()
{ {
text += "Win + "; text += "Win + ";
} }
}
if (IsOnlyModifiers) if (IsOnlyModifiers)
{ {