diff options
| author | 2022-03-04 11:47:13 -0600 | |
|---|---|---|
| committer | 2022-03-21 19:39:33 -0600 | |
| commit | ee532e5c01f97f30078202ae87a5b2a71e9ce1e4 (patch) | |
| tree | 55e544838b029e4a78a61e38cb085f5668400837 /src/input_common/drivers/gc_adapter.cpp | |
| parent | Merge pull request #8048 from ameerj/include-purge (diff) | |
| download | yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.gz yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.tar.xz yuzu-ee532e5c01f97f30078202ae87a5b2a71e9ce1e4.zip | |
input_common: Map sticks correctly when mapped sideways
Diffstat (limited to 'src/input_common/drivers/gc_adapter.cpp')
| -rw-r--r-- | src/input_common/drivers/gc_adapter.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 155caae42..8abd41726 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp | |||
| @@ -524,4 +524,20 @@ Common::Input::ButtonNames GCAdapter::GetUIName(const Common::ParamPackage& para | |||
| 524 | return Common::Input::ButtonNames::Invalid; | 524 | return Common::Input::ButtonNames::Invalid; |
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | bool GCAdapter::IsStickInverted(const Common::ParamPackage& params) { | ||
| 528 | if (!params.Has("port")) { | ||
| 529 | return false; | ||
| 530 | } | ||
| 531 | |||
| 532 | const auto x_axis = static_cast<PadAxes>(params.Get("axis_x", 0)); | ||
| 533 | const auto y_axis = static_cast<PadAxes>(params.Get("axis_y", 0)); | ||
| 534 | if (x_axis != PadAxes::StickY && x_axis != PadAxes::SubstickY) { | ||
| 535 | return false; | ||
| 536 | } | ||
| 537 | if (y_axis != PadAxes::StickX && y_axis != PadAxes::SubstickX) { | ||
| 538 | return false; | ||
| 539 | } | ||
| 540 | return true; | ||
| 541 | } | ||
| 542 | |||
| 527 | } // namespace InputCommon | 543 | } // namespace InputCommon |