CommonHostInterface: Add proper fast forward toggle

This commit is contained in:
Connor McLaughlin 2020-04-25 23:11:47 +10:00
parent 194fc63232
commit a111e36ad7
1 changed files with 12 additions and 2 deletions

View File

@ -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<CommonHostInterface::HostKeyCode>
@ -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)