forked from suyu/suyu
Fixes second controller not detected in DKTF and possibly other games
This commit is contained in:
parent
d12b127c45
commit
3dd0802be6
1 changed files with 8 additions and 10 deletions
|
@ -760,11 +760,14 @@ void EmulatedController::StartMotionCalibration() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
|
void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, Common::UUID uuid) {
|
||||||
Common::UUID uuid) {
|
const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type);
|
||||||
if (index >= controller.button_values.size()) {
|
const auto& player = Settings::values.players.GetValue()[player_index];
|
||||||
|
|
||||||
|
if (index >= controller.button_values.size()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_lock lock{mutex};
|
std::unique_lock lock{mutex};
|
||||||
bool value_changed = false;
|
bool value_changed = false;
|
||||||
const auto new_status = TransformToButton(callback);
|
const auto new_status = TransformToButton(callback);
|
||||||
|
@ -917,13 +920,8 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
|
||||||
|
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
if (!is_connected) {
|
if (player.connected) {
|
||||||
if (npad_id_type == NpadIdType::Player1 && npad_type != NpadStyleIndex::Handheld) {
|
Connect();
|
||||||
Connect();
|
|
||||||
}
|
|
||||||
if (npad_id_type == NpadIdType::Handheld && npad_type == NpadStyleIndex::Handheld) {
|
|
||||||
Connect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TriggerOnChange(ControllerTriggerType::Button, true);
|
TriggerOnChange(ControllerTriggerType::Button, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue