summaryrefslogtreecommitdiff
path: root/src/hid_core/frontend
diff options
context:
space:
mode:
authorGravatar Viktor Szépe2024-01-16 00:09:00 +0000
committerGravatar Viktor Szépe2024-01-16 00:09:00 +0000
commit90ab89a0b0174f8df559b79dc06a03479d959f93 (patch)
tree3d11a790e44945e309f0e68f5332b33b42e72bbb /src/hid_core/frontend
parentFix typos in arrays.xml (diff)
parentMerge pull request #12681 from t895/stick-toggles (diff)
downloadyuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.gz
yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.xz
yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.zip
Merge remote-tracking branch 'origin/master' into typos3
Diffstat (limited to 'src/hid_core/frontend')
-rw-r--r--src/hid_core/frontend/emulated_controller.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp
index 3f36be367..2ab93402d 100644
--- a/src/hid_core/frontend/emulated_controller.cpp
+++ b/src/hid_core/frontend/emulated_controller.cpp
@@ -27,7 +27,7 @@ EmulatedController::~EmulatedController() = default;
27NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) { 27NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerType type) {
28 switch (type) { 28 switch (type) {
29 case Settings::ControllerType::ProController: 29 case Settings::ControllerType::ProController:
30 return NpadStyleIndex::ProController; 30 return NpadStyleIndex::Fullkey;
31 case Settings::ControllerType::DualJoyconDetached: 31 case Settings::ControllerType::DualJoyconDetached:
32 return NpadStyleIndex::JoyconDual; 32 return NpadStyleIndex::JoyconDual;
33 case Settings::ControllerType::LeftJoycon: 33 case Settings::ControllerType::LeftJoycon:
@@ -49,13 +49,13 @@ NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerTyp
49 case Settings::ControllerType::SegaGenesis: 49 case Settings::ControllerType::SegaGenesis:
50 return NpadStyleIndex::SegaGenesis; 50 return NpadStyleIndex::SegaGenesis;
51 default: 51 default:
52 return NpadStyleIndex::ProController; 52 return NpadStyleIndex::Fullkey;
53 } 53 }
54} 54}
55 55
56Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadStyleIndex type) { 56Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadStyleIndex type) {
57 switch (type) { 57 switch (type) {
58 case NpadStyleIndex::ProController: 58 case NpadStyleIndex::Fullkey:
59 return Settings::ControllerType::ProController; 59 return Settings::ControllerType::ProController;
60 case NpadStyleIndex::JoyconDual: 60 case NpadStyleIndex::JoyconDual:
61 return Settings::ControllerType::DualJoyconDetached; 61 return Settings::ControllerType::DualJoyconDetached;
@@ -106,7 +106,7 @@ void EmulatedController::ReloadFromSettings() {
106 SetNpadStyleIndex(MapSettingsTypeToNPad(player.controller_type)); 106 SetNpadStyleIndex(MapSettingsTypeToNPad(player.controller_type));
107 original_npad_type = npad_type; 107 original_npad_type = npad_type;
108 } else { 108 } else {
109 SetNpadStyleIndex(NpadStyleIndex::ProController); 109 SetNpadStyleIndex(NpadStyleIndex::Fullkey);
110 original_npad_type = npad_type; 110 original_npad_type = npad_type;
111 } 111 }
112 112
@@ -1073,7 +1073,7 @@ void EmulatedController::SetColors(const Common::Input::CallbackStatus& callback
1073 .body = GetNpadColor(controller.color_values[index].body), 1073 .body = GetNpadColor(controller.color_values[index].body),
1074 .button = GetNpadColor(controller.color_values[index].buttons), 1074 .button = GetNpadColor(controller.color_values[index].buttons),
1075 }; 1075 };
1076 if (npad_type == NpadStyleIndex::ProController) { 1076 if (npad_type == NpadStyleIndex::Fullkey) {
1077 controller.colors_state.left = { 1077 controller.colors_state.left = {
1078 .body = GetNpadColor(controller.color_values[index].left_grip), 1078 .body = GetNpadColor(controller.color_values[index].left_grip),
1079 .button = GetNpadColor(controller.color_values[index].buttons), 1079 .button = GetNpadColor(controller.color_values[index].buttons),
@@ -1356,7 +1356,7 @@ bool EmulatedController::HasNfc() const {
1356 switch (npad_type) { 1356 switch (npad_type) {
1357 case NpadStyleIndex::JoyconRight: 1357 case NpadStyleIndex::JoyconRight:
1358 case NpadStyleIndex::JoyconDual: 1358 case NpadStyleIndex::JoyconDual:
1359 case NpadStyleIndex::ProController: 1359 case NpadStyleIndex::Fullkey:
1360 case NpadStyleIndex::Handheld: 1360 case NpadStyleIndex::Handheld:
1361 break; 1361 break;
1362 default: 1362 default:
@@ -1548,7 +1548,7 @@ void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles)
1548 // Fallback Fullkey controllers to Pro controllers 1548 // Fallback Fullkey controllers to Pro controllers
1549 if (IsControllerFullkey() && supported_style_tag.fullkey) { 1549 if (IsControllerFullkey() && supported_style_tag.fullkey) {
1550 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Pro controller", npad_type); 1550 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Pro controller", npad_type);
1551 SetNpadStyleIndex(NpadStyleIndex::ProController); 1551 SetNpadStyleIndex(NpadStyleIndex::Fullkey);
1552 Connect(); 1552 Connect();
1553 return; 1553 return;
1554 } 1554 }
@@ -1556,13 +1556,13 @@ void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles)
1556 // Fallback Dual joycon controllers to Pro controllers 1556 // Fallback Dual joycon controllers to Pro controllers
1557 if (npad_type == NpadStyleIndex::JoyconDual && supported_style_tag.fullkey) { 1557 if (npad_type == NpadStyleIndex::JoyconDual && supported_style_tag.fullkey) {
1558 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Pro controller", npad_type); 1558 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Pro controller", npad_type);
1559 SetNpadStyleIndex(NpadStyleIndex::ProController); 1559 SetNpadStyleIndex(NpadStyleIndex::Fullkey);
1560 Connect(); 1560 Connect();
1561 return; 1561 return;
1562 } 1562 }
1563 1563
1564 // Fallback Pro controllers to Dual joycon 1564 // Fallback Pro controllers to Dual joycon
1565 if (npad_type == NpadStyleIndex::ProController && supported_style_tag.joycon_dual) { 1565 if (npad_type == NpadStyleIndex::Fullkey && supported_style_tag.joycon_dual) {
1566 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Dual Joycons", npad_type); 1566 LOG_WARNING(Service_HID, "Reconnecting controller type {} as Dual Joycons", npad_type);
1567 SetNpadStyleIndex(NpadStyleIndex::JoyconDual); 1567 SetNpadStyleIndex(NpadStyleIndex::JoyconDual);
1568 Connect(); 1568 Connect();
@@ -1577,7 +1577,7 @@ bool EmulatedController::IsControllerFullkey(bool use_temporary_value) const {
1577 std::scoped_lock lock{mutex}; 1577 std::scoped_lock lock{mutex};
1578 const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; 1578 const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type;
1579 switch (type) { 1579 switch (type) {
1580 case NpadStyleIndex::ProController: 1580 case NpadStyleIndex::Fullkey:
1581 case NpadStyleIndex::GameCube: 1581 case NpadStyleIndex::GameCube:
1582 case NpadStyleIndex::NES: 1582 case NpadStyleIndex::NES:
1583 case NpadStyleIndex::SNES: 1583 case NpadStyleIndex::SNES:
@@ -1593,7 +1593,7 @@ bool EmulatedController::IsControllerSupported(bool use_temporary_value) const {
1593 std::scoped_lock lock{mutex}; 1593 std::scoped_lock lock{mutex};
1594 const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; 1594 const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type;
1595 switch (type) { 1595 switch (type) {
1596 case NpadStyleIndex::ProController: 1596 case NpadStyleIndex::Fullkey:
1597 return supported_style_tag.fullkey.As<bool>(); 1597 return supported_style_tag.fullkey.As<bool>();
1598 case NpadStyleIndex::Handheld: 1598 case NpadStyleIndex::Handheld:
1599 return supported_style_tag.handheld.As<bool>(); 1599 return supported_style_tag.handheld.As<bool>();