diff options
author | bunnei <bunneidev@gmail.com> | 2022-04-22 07:21:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 07:21:59 +0200 |
commit | 764e5c7fe50bbbc64898fb657cfc5b1f8360454b (patch) | |
tree | ee42eede68cb935595769104e0b94d55b1530141 /src/input_common/main.cpp | |
parent | Merge pull request #8222 from german77/sixaxis_test (diff) | |
parent | input_common: Map sticks correctly when mapped sideways (diff) | |
download | yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar.gz yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar.bz2 yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar.lz yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar.xz yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.tar.zst yuzu-764e5c7fe50bbbc64898fb657cfc5b1f8360454b.zip |
Diffstat (limited to 'src/input_common/main.cpp')
-rw-r--r-- | src/input_common/main.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 28769c6d8..21834fb6b 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp @@ -241,6 +241,28 @@ struct InputSubsystem::Impl { return Common::Input::ButtonNames::Invalid; } + bool IsStickInverted(const Common::ParamPackage& params) { + const std::string engine = params.Get("engine", ""); + if (engine == mouse->GetEngineName()) { + return mouse->IsStickInverted(params); + } + if (engine == gcadapter->GetEngineName()) { + return gcadapter->IsStickInverted(params); + } + if (engine == udp_client->GetEngineName()) { + return udp_client->IsStickInverted(params); + } + if (engine == tas_input->GetEngineName()) { + return tas_input->IsStickInverted(params); + } +#ifdef HAVE_SDL2 + if (engine == sdl->GetEngineName()) { + return sdl->IsStickInverted(params); + } +#endif + return false; + } + bool IsController(const Common::ParamPackage& params) { const std::string engine = params.Get("engine", ""); if (engine == mouse->GetEngineName()) { @@ -384,6 +406,13 @@ bool InputSubsystem::IsController(const Common::ParamPackage& params) const { return impl->IsController(params); } +bool InputSubsystem::IsStickInverted(const Common::ParamPackage& params) const { + if (params.Has("axis_x") && params.Has("axis_y")) { + return impl->IsStickInverted(params); + } + return false; +} + void InputSubsystem::ReloadInputDevices() { impl->udp_client.get()->ReloadSockets(); } |