- To begin, we need to define our FInputAxisKeyMapping or FInputActionKeyMapping objects, depending on whether you are hooking up an Axis key mapping (for buttons that are held down for input) or an Action key mapping (for one-off-event buttons that are pressed once for input).
- To use either of the following classes, we will need to include the following .h file:
#include "GameFramework/PlayerInput.h"
-
- For Axis key mappings, we define an FInputAxisKeyMapping object, as follows:
FInputAxisKeyMapping backKey( "Back", EKeys::S, 1.f );
-
- This will include the string name for the action, the key to press (use the EKeys enum), and whether or not Shift, Ctrl, Alt, or cmd (Mac) should be held to trigger the event.
- For action ...