summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/main.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 97273f967..96998643e 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -207,15 +207,27 @@ void GMainWindow::InitializeRecentFileMenuActions() {
207void GMainWindow::InitializeHotkeys() { 207void GMainWindow::InitializeHotkeys() {
208 RegisterHotkey("Main Window", "Load File", QKeySequence::Open); 208 RegisterHotkey("Main Window", "Load File", QKeySequence::Open);
209 RegisterHotkey("Main Window", "Start Emulation"); 209 RegisterHotkey("Main Window", "Start Emulation");
210 RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4));
210 RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); 211 RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen);
211 RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), 212 RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape),
212 Qt::ApplicationShortcut); 213 Qt::ApplicationShortcut);
214 RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"),
215 Qt::ApplicationShortcut);
213 LoadHotkeys(); 216 LoadHotkeys();
214 217
215 connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, 218 connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this,
216 &GMainWindow::OnMenuLoadFile); 219 &GMainWindow::OnMenuLoadFile);
217 connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, 220 connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this,
218 &GMainWindow::OnStartGame); 221 &GMainWindow::OnStartGame);
222 connect(GetHotkey("Main Window", "Continue/Pause", this), &QShortcut::activated, this, [&] {
223 if (emulation_running) {
224 if (emu_thread->IsRunning()) {
225 OnPauseGame();
226 } else {
227 OnStartGame();
228 }
229 }
230 });
219 connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, 231 connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated,
220 ui.action_Fullscreen, &QAction::trigger); 232 ui.action_Fullscreen, &QAction::trigger);
221 connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, 233 connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously,
@@ -226,6 +238,10 @@ void GMainWindow::InitializeHotkeys() {
226 ToggleFullscreen(); 238 ToggleFullscreen();
227 } 239 }
228 }); 240 });
241 connect(GetHotkey("Main Window", "Toggle Speed Limit", this), &QShortcut::activated, this, [&] {
242 Settings::values.toggle_framelimit = !Settings::values.toggle_framelimit;
243 UpdateStatusBar();
244 });
229} 245}
230 246
231void GMainWindow::SetDefaultUIGeometry() { 247void GMainWindow::SetDefaultUIGeometry() {