/* * Pretty standard functions to catch events that should close a screensaver. * I actually didn't know the screensaver was incharge of this. */ void Main_KeyDown(object sender, KeyEventArgs e) { #if DEBUG /* * Allows a debug build to trigger an unhandled exception by pushing the X key */ if (e.Key == Key.X) { throw new Exception("Key pressed"); return; } else if (e.Key == Key.D) { Window debug_stats = new debug_status(); this.Cursor = Cursors.Arrow; debug_stats.Show(); return; } #endif Application.Current.Shutdown(); }