Fix emulated Home/Guide presses being missed

Fixes #1048
This commit is contained in:
Cameron Gutman
2023-05-24 23:18:47 -05:00
parent 2f4cc9ace0
commit b3f57cf90d

View File

@@ -19,6 +19,9 @@ extern "C" {
#include "thread_pool.h"
#include "utility.h"
#include <boost/chrono.hpp>
#include <boost/thread/thread.hpp>
using namespace std::literals;
namespace input {
@@ -734,6 +737,9 @@ namespace input {
state.buttonFlags |= platf::HOME;
platf::gamepad(platf_input, gamepad.id, state);
// Sleep for a short time to allow the input to be detected
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
// Release Home button
state.buttonFlags &= ~platf::HOME;
platf::gamepad(platf_input, gamepad.id, state);