diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 909f765ef7..96253b2727 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -18,6 +18,7 @@ #include #include "Common/Log.h" #include "Core/Config.h" +#include "Core/Core.h" #include "Core/System.h" #include "Core/HLE/sceCtrl.h" #include "UI/GamepadEmu.h" @@ -124,6 +125,9 @@ void BoolButton::Touch(const TouchInput &input) { if (down != lastDown) { *value_ = down; + UI::EventParams params{ this }; + params.a = down; + OnChange.Trigger(params); } } @@ -580,8 +584,15 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause) { addPSPButton(CTRL_SELECT, rectImage, I_SELECT, g_Config.touchSelectKey); BoolButton *unthrottle = addBoolButton(&PSP_CoreParameter().unthrottle, rectImage, I_ARROW, g_Config.touchUnthrottleKey); - if (unthrottle) + if (unthrottle) { unthrottle->SetAngle(180.0f); + unthrottle->OnChange.Add([](UI::EventParams &e) { + if (e.a) { + Core_EnableStepping(false); + } + return UI::EVENT_DONE; + }); + } FPSLimitButton *speed1 = addFPSLimitButton(FPSLimit::CUSTOM1, rectImage, I_ARROW, g_Config.touchSpeed1Key); if (speed1) diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index 283c093ec0..087fa7da8d 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -77,6 +77,8 @@ public: void Touch(const TouchInput &input) override; bool IsDown() override { return *value_; } + UI::Event OnChange; + private: bool *value_; };