Qt: Add shortcuts to increment fast forward speed (#2903)

Co-authored-by: Vicki Pfau <vi@endrift.com>
This commit is contained in:
sam-gupta-git 2023-04-29 02:33:16 -05:00 committed by GitHub
parent eb26b3c387
commit a7ffcee399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);