Skip to content

Commit

Permalink
Removed async for key inputs as there was no benefit
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpmartell committed Jul 19, 2024
1 parent 33ffc7e commit 16aa4e9
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions LittleWarGameClient/KeyboardHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void TargetWebView_KeyUp(object? sender, KeyEventArgs e)
}


private async void TargetWebView_KeyDown(object? sender, KeyEventArgs e)
private void TargetWebView_KeyDown(object? sender, KeyEventArgs e)
{
#if DEBUG
if (e.KeyData == Keys.F12)
Expand All @@ -51,17 +51,15 @@ private async void TargetWebView_KeyDown(object? sender, KeyEventArgs e)
return;
}
#endif
await Task.Run(() => {
switch (e.KeyData)
{
case Keys.F8:
case Keys.F9:
case Keys.F10:
case Keys.F11:
e.Handled = true;
break;
}
});
switch (e.KeyData)
{
case Keys.F8:
case Keys.F9:
case Keys.F10:
case Keys.F11:
e.Handled = true;
break;
}
}
}
}

0 comments on commit 16aa4e9

Please sign in to comment.