Added: disable hotkeys in debug mode

This commit is contained in:
Ray 2021-07-24 21:20:50 +01:00
parent 6e13011147
commit 5af2eb7b54

View File

@ -123,7 +123,9 @@ namespace FizzyLauncher
{ {
if (this.CurrentSession.HotKey.KeyCode != Keys.None) if (this.CurrentSession.HotKey.KeyCode != Keys.None)
{ {
#if !DEBUG
UnregisterHotKey((IntPtr)Handle, 1); UnregisterHotKey((IntPtr)Handle, 1);
#endif
} }
} }
@ -189,6 +191,7 @@ namespace FizzyLauncher
protected void invalidateHotKey() protected void invalidateHotKey()
{ {
#if !DEBUG
if (this.InvokeRequired) if (this.InvokeRequired)
{ {
this.Invoke(new MethodInvoker(() => this.Invoke(new MethodInvoker(() =>
@ -200,11 +203,13 @@ namespace FizzyLauncher
{ {
UnregisterHotKey((IntPtr)Handle, 1); UnregisterHotKey((IntPtr)Handle, 1);
} }
#endif
if (this.CurrentSession.HotKey != null) if (this.CurrentSession.HotKey != null)
{ {
if (this.CurrentSession.HotKey.KeyCode != Keys.None) if (this.CurrentSession.HotKey.KeyCode != Keys.None)
{ {
#if !DEBUG
if (this.InvokeRequired) if (this.InvokeRequired)
{ {
this.Invoke(new MethodInvoker(() => this.Invoke(new MethodInvoker(() =>
@ -216,6 +221,7 @@ namespace FizzyLauncher
{ {
RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.HotKey.ModifierCode, this.CurrentSession.HotKey.Key); RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.HotKey.ModifierCode, this.CurrentSession.HotKey.Key);
} }
#endif
} }
} }
} }