From a111e36ad73df10cc5b0df7a94786be5caa98de1 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 25 Apr 2020 23:11:47 +1000 Subject: [PATCH] CommonHostInterface: Add proper fast forward toggle --- src/frontend-common/common_host_interface.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index b3813b9c6..0923db00b 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -401,7 +401,6 @@ void CommonHostInterface::SetDefaultSettings(SettingsInterface& si) si.SetStringValue("Hotkeys", "IncreaseResolutionScale", "Keyboard/PageUp"); si.SetStringValue("Hotkeys", "DecreaseResolutionScale", "Keyboard/PageDown"); si.SetStringValue("Hotkeys", "ToggleSoftwareRendering", "Keyboard/End"); - } std::optional @@ -720,12 +719,23 @@ bool CommonHostInterface::AddRumbleToInputMap(const std::string& binding, u32 co void CommonHostInterface::RegisterGeneralHotkeys() { - RegisterHotkey(StaticString("General"), StaticString("FastForward"), StaticString("Toggle Fast Forward"), + RegisterHotkey(StaticString("General"), StaticString("FastForward"), StaticString("Fast Forward"), [this](bool pressed) { m_speed_limiter_temp_disabled = pressed; HostInterface::UpdateSpeedLimiterState(); }); + RegisterHotkey(StaticString("General"), StaticString("ToggleFastForward"), StaticString("Toggle Fast Forward"), + [this](bool pressed) { + if (!pressed) + { + m_speed_limiter_temp_disabled = !m_speed_limiter_temp_disabled; + HostInterface::UpdateSpeedLimiterState(); + AddFormattedOSDMessage(1.0f, "Speed limiter %s.", + m_speed_limiter_enabled ? "enabled" : "disabled"); + } + }); + RegisterHotkey(StaticString("General"), StaticString("ToggleFullscreen"), StaticString("Toggle Fullscreen"), [this](bool pressed) { if (!pressed)