mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
fixed #240: Workaround for hotkey Windows modifier support
This commit is contained in:
parent
22c32db065
commit
8a011a5611
2 changed files with 20 additions and 18 deletions
|
@ -128,6 +128,11 @@ private void btnHotkey_KeyDown(object sender, KeyEventArgs e)
|
|||
Setting.HotkeyInfo.Hotkey = Keys.None;
|
||||
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)
|
||||
{
|
||||
Setting.HotkeyInfo.Hotkey = e.KeyData;
|
||||
|
|
|
@ -101,7 +101,7 @@ public bool IsOnlyModifiers
|
|||
{
|
||||
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;
|
||||
|
||||
if (KeyCode != Keys.None)
|
||||
{
|
||||
if (Control)
|
||||
{
|
||||
text += "Ctrl + ";
|
||||
|
@ -155,7 +153,6 @@ public override string ToString()
|
|||
{
|
||||
text += "Win + ";
|
||||
}
|
||||
}
|
||||
|
||||
if (IsOnlyModifiers)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue