Axis Mappings and Action Mappings can be added to your game via the UE4 Editor and is often how designers will do it, but we can also add them directly from C++ code. Since the connections to C++ functions is from C++ code anyway, you may find it more convenient to define your Axis and Action Mappings in C++ as well.
Adding Axis and Action Mappings from C++
Getting ready
You need a UE4 project that you'd like to add some Axis and Action mappings to. You can delete the existing Axis and Action mappings listed in Settings | Project Settings | Input if you are adding them via C++ code.
To add your custom Axis and Action Mappings, there are two C++ functions that you need to know about: UPlayerInput::AddAxisMapping and UPlayerInput...