Ejemplo n.º 1
0
 private static void OnKeyUp(object sender, KeyboardEventArgs e)
 {
     if (e.Key == Keys.Escape)
     {
         _isKeyDown = false;
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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);
     }
 }