mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu.git
				synced 2025-05-12 00:45:25 +00:00 
			
		
		
		
	Merge pull request #839 from FearlessTobi/actually-port-3594
Port #3594 from Citra: "citra_qt: Add Continue/Pause & Toggle Speed Limit hotkeys"
This commit is contained in:
		
						commit
						2128ab2d21
					
				| @ -207,15 +207,27 @@ void GMainWindow::InitializeRecentFileMenuActions() { | |||||||
| void GMainWindow::InitializeHotkeys() { | void GMainWindow::InitializeHotkeys() { | ||||||
|     RegisterHotkey("Main Window", "Load File", QKeySequence::Open); |     RegisterHotkey("Main Window", "Load File", QKeySequence::Open); | ||||||
|     RegisterHotkey("Main Window", "Start Emulation"); |     RegisterHotkey("Main Window", "Start Emulation"); | ||||||
|  |     RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4)); | ||||||
|     RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); |     RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); | ||||||
|     RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), |     RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), | ||||||
|                    Qt::ApplicationShortcut); |                    Qt::ApplicationShortcut); | ||||||
|  |     RegisterHotkey("Main Window", "Toggle Speed Limit", QKeySequence("CTRL+Z"), | ||||||
|  |                    Qt::ApplicationShortcut); | ||||||
|     LoadHotkeys(); |     LoadHotkeys(); | ||||||
| 
 | 
 | ||||||
|     connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, |     connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this, | ||||||
|             &GMainWindow::OnMenuLoadFile); |             &GMainWindow::OnMenuLoadFile); | ||||||
|     connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, |     connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this, | ||||||
|             &GMainWindow::OnStartGame); |             &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, |     connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, | ||||||
|             ui.action_Fullscreen, &QAction::trigger); |             ui.action_Fullscreen, &QAction::trigger); | ||||||
|     connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, |     connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, | ||||||
| @ -226,6 +238,10 @@ void GMainWindow::InitializeHotkeys() { | |||||||
|             ToggleFullscreen(); |             ToggleFullscreen(); | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|  |     connect(GetHotkey("Main Window", "Toggle Speed Limit", this), &QShortcut::activated, this, [&] { | ||||||
|  |         Settings::values.toggle_framelimit = !Settings::values.toggle_framelimit; | ||||||
|  |         UpdateStatusBar(); | ||||||
|  |     }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GMainWindow::SetDefaultUIGeometry() { | void GMainWindow::SetDefaultUIGeometry() { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 bunnei
						bunnei