private static void OnKeyUp(object sender, KeyboardEventArgs e) { if (e.Key == Keys.Escape) { _isKeyDown = false; } }
private static void OnKeyDown(object sender, KeyboardEventArgs e) { if (!_isKeyDown && e.Key == Keys.Escape && Keyboard.Modifiers == ModifierKeys.None) { _isKeyDown = true; e.Handled |= ContinueRace(); } }
private void OnKeyUp(object sender, KeyboardEventArgs e) { try { if (e.Key == Keys.Escape && Keyboard.Modifiers == ModifierKeys.None) { Logging.Write("Escape was pressed, terminating loading…"); _sharedCancellationTokenSource?.Cancel(); } } catch (Exception ex) { Logging.Error(ex); } }