[= Audy;98628]
If you search the code you’ll find many examples of FSlateApplication::Get() to get you the slate application, from there you can call the appropriate function to route your axis through. I think the best bet is OnControllerAnalog which can take an FKey for the axis and the current AnalogValue. It also takes a ControllerId, which I think, probably makes the most sense to just pass 0 as the first controller.
[/]
Yep that did it, but I have to say quite a few of the details are still undocumented and convoluted. E.g. needing to #define LOCTEXT_NAMESPACE “(subcategory)”,
including “Slate.h”, and adding InputCore and Slate to your plugin module build settings. In addition to that any controller id apart from 0 doesn’t work (does it assume a second player?) and the Plugin Actor derived classes can’t seem to forward key Events (I’m guessing has to do with the input chain as a Controller derived class does forward them).
But hey you learn the standards only once
Plugin V0.6, UE4.3
Thanks to 's hints, the plugin has now been updated to support Input Mapping!
Example usage in the third person template:
You can find these settings under Edit->Project Settings->Engine->Input. You can use key events in addition to the standard hydra events from a HydraPlayerController derived blueprint. makes adding hydra support to any project a breeze, but the input mapping events do not include integrated or historical data. If you want to do manual gesture detection or more involved input manipulation I still recommend using blueprint events or the C++ delegate.
Feedback is always welcome, let me know if you find any bugs!
Input Mapping Hints:
-Motion is defined as a -1.0 to 1.0 scale for each axis. The range is capped at 2 meters from the base to provide fuller range, you may need to scale value if you’re using it as motion input rather than 1:1 world mapping.
-Rotation is scaled to -1.0 to 1.0 in each axis, again to provide snappier input you may need to scale the values.
-Joystick Trigger emits both its axis value and a ‘click’ defined by value >=0.5
Leftover Todo:
-Shipping build fix via conditional build (shipping builds seem to swallow the plugin into project code, unsure of best practices)