diff options
Diffstat (limited to '')
| -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 { | |||
| 241 | return Common::Input::ButtonNames::Invalid; | 241 | return Common::Input::ButtonNames::Invalid; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | bool IsStickInverted(const Common::ParamPackage& params) { | ||
| 245 | const std::string engine = params.Get("engine", ""); | ||
| 246 | if (engine == mouse->GetEngineName()) { | ||
| 247 | return mouse->IsStickInverted(params); | ||
| 248 | } | ||
| 249 | if (engine == gcadapter->GetEngineName()) { | ||
| 250 | return gcadapter->IsStickInverted(params); | ||
| 251 | } | ||
| 252 | if (engine == udp_client->GetEngineName()) { | ||
| 253 | return udp_client->IsStickInverted(params); | ||
| 254 | } | ||
| 255 | if (engine == tas_input->GetEngineName()) { | ||
| 256 | return tas_input->IsStickInverted(params); | ||
| 257 | } | ||
| 258 | #ifdef HAVE_SDL2 | ||
| 259 | if (engine == sdl->GetEngineName()) { | ||
| 260 | return sdl->IsStickInverted(params); | ||
| 261 | } | ||
| 262 | #endif | ||
| 263 | return false; | ||
| 264 | } | ||
| 265 | |||
| 244 | bool IsController(const Common::ParamPackage& params) { | 266 | bool IsController(const Common::ParamPackage& params) { |
| 245 | const std::string engine = params.Get("engine", ""); | 267 | const std::string engine = params.Get("engine", ""); |
| 246 | if (engine == mouse->GetEngineName()) { | 268 | if (engine == mouse->GetEngineName()) { |
| @@ -384,6 +406,13 @@ bool InputSubsystem::IsController(const Common::ParamPackage& params) const { | |||
| 384 | return impl->IsController(params); | 406 | return impl->IsController(params); |
| 385 | } | 407 | } |
| 386 | 408 | ||
| 409 | bool InputSubsystem::IsStickInverted(const Common::ParamPackage& params) const { | ||
| 410 | if (params.Has("axis_x") && params.Has("axis_y")) { | ||
| 411 | return impl->IsStickInverted(params); | ||
| 412 | } | ||
| 413 | return false; | ||
| 414 | } | ||
| 415 | |||
| 387 | void InputSubsystem::ReloadInputDevices() { | 416 | void InputSubsystem::ReloadInputDevices() { |
| 388 | impl->udp_client.get()->ReloadSockets(); | 417 | impl->udp_client.get()->ReloadSockets(); |
| 389 | } | 418 | } |