diff options
Diffstat (limited to 'src/input_common/drivers/udp_client.cpp')
| -rw-r--r-- | src/input_common/drivers/udp_client.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp index 9780ead10..825262a07 100644 --- a/src/input_common/drivers/udp_client.cpp +++ b/src/input_common/drivers/udp_client.cpp | |||
| @@ -547,6 +547,22 @@ Common::Input::ButtonNames UDPClient::GetUIName(const Common::ParamPackage& para | |||
| 547 | return Common::Input::ButtonNames::Invalid; | 547 | return Common::Input::ButtonNames::Invalid; |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | bool UDPClient::IsStickInverted(const Common::ParamPackage& params) { | ||
| 551 | if (!params.Has("guid") || !params.Has("port") || !params.Has("pad")) { | ||
| 552 | return false; | ||
| 553 | } | ||
| 554 | |||
| 555 | const auto x_axis = static_cast<PadAxes>(params.Get("axis_x", 0)); | ||
| 556 | const auto y_axis = static_cast<PadAxes>(params.Get("axis_y", 0)); | ||
| 557 | if (x_axis != PadAxes::LeftStickY && x_axis != PadAxes::RightStickY) { | ||
| 558 | return false; | ||
| 559 | } | ||
| 560 | if (y_axis != PadAxes::LeftStickX && y_axis != PadAxes::RightStickX) { | ||
| 561 | return false; | ||
| 562 | } | ||
| 563 | return true; | ||
| 564 | } | ||
| 565 | |||
| 550 | void TestCommunication(const std::string& host, u16 port, | 566 | void TestCommunication(const std::string& host, u16 port, |
| 551 | const std::function<void()>& success_callback, | 567 | const std::function<void()>& success_callback, |
| 552 | const std::function<void()>& failure_callback) { | 568 | const std::function<void()>& failure_callback) { |