mirror of
https://github.com/ndeadly/MissionControl
synced 2024-11-22 04:13:07 +00:00
mc.mitm: check vendor/product id when identifying official switch controllers before falling back to checking the name
This commit is contained in:
parent
9306dbe0d3
commit
913c89baf6
1 changed files with 7 additions and 0 deletions
|
@ -47,6 +47,13 @@ namespace ams::controller {
|
|||
|
||||
ControllerType Identify(const bluetooth::DevicesSettings *device) {
|
||||
|
||||
for (auto hwId : SwitchController::hardware_ids) {
|
||||
if ( (device->vid == hwId.vid) && (device->pid == hwId.pid) ) {
|
||||
return ControllerType_Switch;
|
||||
}
|
||||
}
|
||||
|
||||
// Additionally check controller name against known official Nintendo controllers, as some controllers (eg. JoyCons paired via rails) don't report the correct vid/pid
|
||||
if (IsOfficialSwitchControllerName(hos::GetVersion() < hos::Version_13_0_0 ? device->name.name : device->name2))
|
||||
return ControllerType_Switch;
|
||||
|
||||
|
|
Loading…
Reference in a new issue