mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 16:25:45 +00:00
configure_input: Modify controller connection delay
Increases the controller connection delay to 60ms and refactors it to attempt to disconnect all controllers prior to connecting all controllers in HID.
This commit is contained in:
parent
1c53456c3c
commit
dd73d7eb8e
4 changed files with 47 additions and 12 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include <QSignalBlocker>
|
||||
#include <QTimer>
|
||||
|
@ -181,8 +182,18 @@ QList<QWidget*> ConfigureInput::GetSubTabs() const {
|
|||
}
|
||||
|
||||
void ConfigureInput::ApplyConfiguration() {
|
||||
for (auto controller : player_controllers) {
|
||||
for (auto* controller : player_controllers) {
|
||||
controller->ApplyConfiguration();
|
||||
controller->TryDisconnectSelectedController();
|
||||
}
|
||||
|
||||
// This emulates a delay between disconnecting and reconnecting controllers as some games
|
||||
// do not respond to a change in controller type if it was instantaneous.
|
||||
using namespace std::chrono_literals;
|
||||
std::this_thread::sleep_for(60ms);
|
||||
|
||||
for (auto* controller : player_controllers) {
|
||||
controller->TryConnectSelectedController();
|
||||
}
|
||||
|
||||
advanced->ApplyConfiguration();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue