mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 14:11:38 +12:00
fixed #240: Workaround for hotkey Windows modifier support
This commit is contained in:
parent
22c32db065
commit
8a011a5611
|
@ -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;
|
||||||
|
|
|
@ -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,27 +134,24 @@ public override string ToString()
|
||||||
{
|
{
|
||||||
string text = string.Empty;
|
string text = string.Empty;
|
||||||
|
|
||||||
if (KeyCode != Keys.None)
|
if (Control)
|
||||||
{
|
{
|
||||||
if (Control)
|
text += "Ctrl + ";
|
||||||
{
|
}
|
||||||
text += "Ctrl + ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Shift)
|
if (Shift)
|
||||||
{
|
{
|
||||||
text += "Shift + ";
|
text += "Shift + ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Alt)
|
if (Alt)
|
||||||
{
|
{
|
||||||
text += "Alt + ";
|
text += "Alt + ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Win)
|
if (Win)
|
||||||
{
|
{
|
||||||
text += "Win + ";
|
text += "Win + ";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsOnlyModifiers)
|
if (IsOnlyModifiers)
|
||||||
|
|
Loading…
Reference in a new issue