예제 #1
0
 private static void OnKeyUp(object sender, KeyboardEventArgs e)
 {
     if (e.Key == Keys.Escape)
     {
         _isKeyDown = false;
     }
 }
예제 #2
0
 private static void OnKeyDown(object sender, KeyboardEventArgs e)
 {
     if (!_isKeyDown && e.Key == Keys.Escape && Keyboard.Modifiers == ModifierKeys.None)
     {
         _isKeyDown = true;
         e.Handled |= ContinueRace();
     }
 }
예제 #3
0
 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);
     }
 }