Switcheroo - Detect which input device the player is using

switcheroo-banner

Marketplace - Docs - Try the demo - Join the Discord

Easily detect whether the player is using a gamepad or the keyboard/mouse combo, and react accordingly.

Features

  • State-of-the-art input detection. The plugin automatically filters out edge cases and false positives (such as input coming from a loose analog stick, or from involuntary mouse movements) and is highly customizable.
  • Plug and Play. The plugin doesn’t require any special setup (like custom GameInstance or PlayerController classes): enabling the plugin is all it takes to be up-and-running.
  • Easy to use. Switcheroo provides a simple API that can be used from both Blueprints and C++.
  • Lightweight. The plugin logic is implemented in native C++ code and runs at the Slate application level with no impact on performance.
  • Supported. The plugin is actively used in a game live on Steam and Xbox, and will receive all the needed lifetime upgrades.
  • Source code & example project. Switcheroo comes with full, heavily commented source code and a thorough example project.

Screens



UE 4.21 is now supported.

This is great, I have written this before for a few projects and I always hit a snag and wondered if your system can support it - Can your plugin tell the difference between PS4 and Xbox controller when used on windows? Steam shows 12 million users now using PS4 controllers for pc now so I want to support it but never found a way to get beyond “gamepad” as the filter and really get into what controller.

Thanks for the nice words! No, the plugin relies on the information provided by UE4 which, as you found out and AFAIK, on Windows is limited to XInput devices (i.e. 360-compatible gamepads).

From my understanding, though, most players use PS4 controllers through some kind of XInput emulation (i.e. DS4Windows), so for the moment in our game we let players select the type of controller they wish to use in the options screen and then show appropriate controls based on that - although I agree that’s sub-optimal. If we revisit that in the future, I’ll consider porting the feature to Switcheroo (or make a standalone plugin if the implementation gets too complex).

Version 1.2 is available for UE4.20 and later.

Changelog

  • Added experimental support for detecting input from motion controllers, to make it possible to use the plugin in VR projects. This is treated as gamepad input for now.
  • Fixed mouse wheel input not being detected (4.22 and up only - support for detecting this type of input wasn’t available in previous engine versions).

(Unfortunately Epic only builds code plugins against the latest three versions of the engine, so I couldn’t distribute version 1.2 for UE4.18 and 4.19 through the marketplace. If someone is stuck on those engine versions and needs to use the plugin in a VR project, please get in touch.)

This is exactly what I needed, thanks!!

Glad you found it useful and thanks for the review! Feel free to get in touch if you have any questions.

This is a fantastic plugin. Documentation and source are 5 stars. I’m curious, did you happen to read my Gamasutra article from years ago? This plugin makes it easy to implement several of the rules that I outlined and gives UE4 developers a nice modular way to use that behavior across projects.

Thanks for the nice words about the plugin! Yes, your article has proved invaluable when first working on input management for my game (some parts of which were later refactored into this plugin). Thanks for taking the time to write it!