From 18c2c9692777d664f6641450521a99578886add8 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Thu, 26 Jul 2018 16:09:52 +0200 Subject: [PATCH] Port #3594 from Citra --- src/yuzu/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3c2726498d..af9ed8fda0 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -205,15 +205,27 @@ void GMainWindow::InitializeRecentFileMenuActions() { void GMainWindow::InitializeHotkeys() { RegisterHotkey("Main Window", "Load File", QKeySequence::Open); RegisterHotkey("Main Window", "Start Emulation"); + RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4)); RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), Qt::ApplicationShortcut); + RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"), + Qt::ApplicationShortcut); LoadHotkeys(); connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, &GMainWindow::OnMenuLoadFile); connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, &GMainWindow::OnStartGame); + connect(GetHotkey("Main Window", "Continue/Pause", this), &QShortcut::activated, this, [&] { + if (emulation_running) { + if (emu_thread->IsRunning()) { + OnPauseGame(); + } else { + OnStartGame(); + } + } + }); connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, ui.action_Fullscreen, &QAction::trigger); connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, @@ -224,6 +236,10 @@ void GMainWindow::InitializeHotkeys() { ToggleFullscreen(); } }); + connect(GetHotkey("Main Window", "Toggle Speed Limit", this), &QShortcut::activated, this, [&] { + Settings::values.toggle_framelimit = !Settings::values.toggle_framelimit; + UpdateStatusBar(); + }); } void GMainWindow::SetDefaultUIGeometry() {