protected override void OnKeyDown(KeyboardKeyEventArgs e) { base.OnKeyDown(e); if (KeyboardMap.TryGetValue(e.Key, out byte value)) { vm?.KeyDown(value); return; } switch (e.Key) { case Key.Escape: Close(); break; case Key.G: vm?.DebugGraphics(); break; case Key.M: vm?.DebugMemory(); break; case Key.R: vm?.DebugRegisters(); break; case Key.P: running = !running; break; case Key.S: vm?.EmulateCycle(); vm?.DebugRegisters(); break; case Key.BackSpace: vm?.Reset(); break; default: break; } }