summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hid/emulated_controller.cpp8
-rw-r--r--src/input_common/drivers/udp_client.cpp24
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp15
3 files changed, 30 insertions, 17 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 71fc05807..52a56ef1a 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -389,7 +389,8 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
389 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { 389 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) {
390 return param.Get("engine", "") == param_.Get("engine", "") && 390 return param.Get("engine", "") == param_.Get("engine", "") &&
391 param.Get("guid", "") == param_.Get("guid", "") && 391 param.Get("guid", "") == param_.Get("guid", "") &&
392 param.Get("port", 0) == param_.Get("port", 0); 392 param.Get("port", 0) == param_.Get("port", 0) &&
393 param.Get("pad", 0) == param_.Get("pad", 0);
393 }); 394 });
394 if (devices_it != devices.end()) { 395 if (devices_it != devices.end()) {
395 continue; 396 continue;
@@ -398,6 +399,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
398 device.Set("engine", param.Get("engine", "")); 399 device.Set("engine", param.Get("engine", ""));
399 device.Set("guid", param.Get("guid", "")); 400 device.Set("guid", param.Get("guid", ""));
400 device.Set("port", param.Get("port", 0)); 401 device.Set("port", param.Get("port", 0));
402 device.Set("pad", param.Get("pad", 0));
401 devices.push_back(device); 403 devices.push_back(device);
402 } 404 }
403 405
@@ -412,7 +414,8 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
412 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { 414 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) {
413 return param.Get("engine", "") == param_.Get("engine", "") && 415 return param.Get("engine", "") == param_.Get("engine", "") &&
414 param.Get("guid", "") == param_.Get("guid", "") && 416 param.Get("guid", "") == param_.Get("guid", "") &&
415 param.Get("port", 0) == param_.Get("port", 0); 417 param.Get("port", 0) == param_.Get("port", 0) &&
418 param.Get("pad", 0) == param_.Get("pad", 0);
416 }); 419 });
417 if (devices_it != devices.end()) { 420 if (devices_it != devices.end()) {
418 continue; 421 continue;
@@ -421,6 +424,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
421 device.Set("engine", param.Get("engine", "")); 424 device.Set("engine", param.Get("engine", ""));
422 device.Set("guid", param.Get("guid", "")); 425 device.Set("guid", param.Get("guid", ""));
423 device.Set("port", param.Get("port", 0)); 426 device.Set("port", param.Get("port", 0));
427 device.Set("pad", param.Get("pad", 0));
424 devices.push_back(device); 428 devices.push_back(device);
425 } 429 }
426 return devices; 430 return devices;
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp
index a1ce4525d..c8a12c7d5 100644
--- a/src/input_common/drivers/udp_client.cpp
+++ b/src/input_common/drivers/udp_client.cpp
@@ -442,14 +442,22 @@ MotionMapping UDPClient::GetMotionMappingForDevice(const Common::ParamPackage& p
442 } 442 }
443 443
444 MotionMapping mapping = {}; 444 MotionMapping mapping = {};
445 Common::ParamPackage motion_params; 445 Common::ParamPackage left_motion_params;
446 motion_params.Set("engine", GetEngineName()); 446 left_motion_params.Set("engine", GetEngineName());
447 motion_params.Set("guid", params.Get("guid", "")); 447 left_motion_params.Set("guid", params.Get("guid", ""));
448 motion_params.Set("port", params.Get("port", 0)); 448 left_motion_params.Set("port", params.Get("port", 0));
449 motion_params.Set("pad", params.Get("pad", 0)); 449 left_motion_params.Set("pad", params.Get("pad", 0));
450 motion_params.Set("motion", 0); 450 left_motion_params.Set("motion", 0);
451 mapping.insert_or_assign(Settings::NativeMotion::MotionLeft, std::move(motion_params)); 451
452 mapping.insert_or_assign(Settings::NativeMotion::MotionRight, std::move(motion_params)); 452 Common::ParamPackage right_motion_params;
453 right_motion_params.Set("engine", GetEngineName());
454 right_motion_params.Set("guid", params.Get("guid", ""));
455 right_motion_params.Set("port", params.Get("port", 0));
456 right_motion_params.Set("pad", params.Get("pad", 0));
457 right_motion_params.Set("motion", 0);
458
459 mapping.insert_or_assign(Settings::NativeMotion::MotionLeft, std::move(left_motion_params));
460 mapping.insert_or_assign(Settings::NativeMotion::MotionRight, std::move(right_motion_params));
453 return mapping; 461 return mapping;
454} 462}
455 463
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index 8c6249fc2..b9342466e 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -747,15 +747,16 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() {
747 const auto first_engine = devices[0].Get("engine", ""); 747 const auto first_engine = devices[0].Get("engine", "");
748 const auto first_guid = devices[0].Get("guid", ""); 748 const auto first_guid = devices[0].Get("guid", "");
749 const auto first_port = devices[0].Get("port", 0); 749 const auto first_port = devices[0].Get("port", 0);
750 const auto first_pad = devices[0].Get("pad", 0);
750 751
751 if (devices.size() == 1) { 752 if (devices.size() == 1) {
752 const auto devices_it = 753 const auto devices_it = std::find_if(
753 std::find_if(input_devices.begin(), input_devices.end(), 754 input_devices.begin(), input_devices.end(),
754 [first_engine, first_guid, first_port](const Common::ParamPackage param) { 755 [first_engine, first_guid, first_port, first_pad](const Common::ParamPackage param) {
755 return param.Get("engine", "") == first_engine && 756 return param.Get("engine", "") == first_engine &&
756 param.Get("guid", "") == first_guid && 757 param.Get("guid", "") == first_guid && param.Get("port", 0) == first_port &&
757 param.Get("port", 0) == first_port; 758 param.Get("pad", 0) == first_pad;
758 }); 759 });
759 const int device_index = 760 const int device_index =
760 devices_it != input_devices.end() 761 devices_it != input_devices.end()
761 ? static_cast<int>(std::distance(input_devices.begin(), devices_it)) 762 ? static_cast<int>(std::distance(input_devices.begin(), devices_it))