From a7ffcee399822f8cf5c667a4b97fdf27f4d03559 Mon Sep 17 00:00:00 2001 From: sam-gupta-git <89882137+sam-gupta-git@users.noreply.github.com> Date: Sat, 29 Apr 2023 02:33:16 -0500 Subject: [PATCH] Qt: Add shortcuts to increment fast forward speed (#2903) Co-authored-by: Vicki Pfau --- src/platform/qt/Window.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index f10bdebb6..c39f3a8f8 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1429,6 +1429,20 @@ void Window::setupMenu(QMenuBar* menubar) { } m_config->updateOption("fastForwardRatio"); + addGameAction(tr("Increase fast forward speed"), "fastForwardUp", [this] { + float newRatio = m_config->getOption("fastForwardRatio", 1.0f).toFloat() + 1.0f; + if (newRatio >= 3.0f) { + m_config->setOption("fastForwardRatio", QVariant(newRatio)); + } + }, "emu"); + + addGameAction(tr("Decrease fast forward speed"), "fastForwardDown", [this] { + float newRatio = m_config->getOption("fastForwardRatio").toFloat() - 1.0f; + if (newRatio >= 2.0f) { + m_config->setOption("fastForwardRatio", QVariant(newRatio)); + } + }, "emu"); + Action* rewindHeld = m_actions.addHeldAction(tr("Rewind (held)"), "holdRewind", [this](bool held) { if (m_controller) { m_controller->setRewinding(held);