diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-03-04 18:47:13 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2022-03-22 02:39:33 +0100 |
commit | ee532e5c01f97f30078202ae87a5b2a71e9ce1e4 (patch) | |
tree | 55e544838b029e4a78a61e38cb085f5668400837 /src/input_common/drivers/udp_client.cpp | |
parent | Merge pull request #8048 from ameerj/include-purge (diff) | |
download | yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.gz yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.bz2 yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.lz yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.xz yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.zst yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.zip |
Diffstat (limited to '')
-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 return Common::Input::ButtonNames::Invalid; } +bool UDPClient::IsStickInverted(const Common::ParamPackage& params) { + if (!params.Has("guid") || !params.Has("port") || !params.Has("pad")) { + return false; + } + + const auto x_axis = static_cast<PadAxes>(params.Get("axis_x", 0)); + const auto y_axis = static_cast<PadAxes>(params.Get("axis_y", 0)); + if (x_axis != PadAxes::LeftStickY && x_axis != PadAxes::RightStickY) { + return false; + } + if (y_axis != PadAxes::LeftStickX && y_axis != PadAxes::RightStickX) { + return false; + } + return true; +} + void TestCommunication(const std::string& host, u16 port, const std::function<void()>& success_callback, const std::function<void()>& failure_callback) { |