diff options
| author | 2018-07-26 16:09:52 +0200 | |
|---|---|---|
| committer | 2018-07-26 16:09:52 +0200 | |
| commit | 18c2c9692777d664f6641450521a99578886add8 (patch) | |
| tree | dda5106df321f0729b3b9c3e9f3ac643a163cc30 | |
| parent | Merge pull request #827 from lioncash/log (diff) | |
| download | yuzu-18c2c9692777d664f6641450521a99578886add8.tar.gz yuzu-18c2c9692777d664f6641450521a99578886add8.tar.xz yuzu-18c2c9692777d664f6641450521a99578886add8.zip | |
Port #3594 from Citra
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3c2726498..af9ed8fda 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -205,15 +205,27 @@ void GMainWindow::InitializeRecentFileMenuActions() { | |||
| 205 | void GMainWindow::InitializeHotkeys() { | 205 | void GMainWindow::InitializeHotkeys() { |
| 206 | RegisterHotkey("Main Window", "Load File", QKeySequence::Open); | 206 | RegisterHotkey("Main Window", "Load File", QKeySequence::Open); |
| 207 | RegisterHotkey("Main Window", "Start Emulation"); | 207 | RegisterHotkey("Main Window", "Start Emulation"); |
| 208 | RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4)); | ||
| 208 | RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); | 209 | RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); |
| 209 | RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), | 210 | RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), |
| 210 | Qt::ApplicationShortcut); | 211 | Qt::ApplicationShortcut); |
| 212 | RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"), | ||
| 213 | Qt::ApplicationShortcut); | ||
| 211 | LoadHotkeys(); | 214 | LoadHotkeys(); |
| 212 | 215 | ||
| 213 | connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, | 216 | connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, |
| 214 | &GMainWindow::OnMenuLoadFile); | 217 | &GMainWindow::OnMenuLoadFile); |
| 215 | connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, | 218 | connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, |
| 216 | &GMainWindow::OnStartGame); | 219 | &GMainWindow::OnStartGame); |
| 220 | connect(GetHotkey("Main Window", "Continue/Pause", this), &QShortcut::activated, this, [&] { | ||
| 221 | if (emulation_running) { | ||
| 222 | if (emu_thread->IsRunning()) { | ||
| 223 | OnPauseGame(); | ||
| 224 | } else { | ||
| 225 | OnStartGame(); | ||
| 226 | } | ||
| 227 | } | ||
| 228 | }); | ||
| 217 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, | 229 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, |
| 218 | ui.action_Fullscreen, &QAction::trigger); | 230 | ui.action_Fullscreen, &QAction::trigger); |
| 219 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, | 231 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, |
| @@ -224,6 +236,10 @@ void GMainWindow::InitializeHotkeys() { | |||
| 224 | ToggleFullscreen(); | 236 | ToggleFullscreen(); |
| 225 | } | 237 | } |
| 226 | }); | 238 | }); |
| 239 | connect(GetHotkey("Main Window", "Toggle Speed Limit", this), &QShortcut::activated, this, [&] { | ||
| 240 | Settings::values.toggle_framelimit = !Settings::values.toggle_framelimit; | ||
| 241 | UpdateStatusBar(); | ||
| 242 | }); | ||
| 227 | } | 243 | } |
| 228 | 244 | ||
| 229 | void GMainWindow::SetDefaultUIGeometry() { | 245 | void GMainWindow::SetDefaultUIGeometry() { |