I am trying to create a keybinds system that automatically removes any input mappings that uses the same input as the new input. In order to do this, I need to create an array holding all keybindings that I can loop through and check for mappings that use the same input key as the mapping I am creating.
I have tried to use the GetActionMappings and GetAxisMappings, but I cant seem to populate my Arrays with them. My code compiles and runs without a hitch, but the Debug Messages only prints once, while each should print at least six times.
Am I doing this correctly? Or have I fundamentally misunderstood how the code is suppossed to be implemented?
TArray<FInputAxisKeyMapping> testArrayAxis;
TArray<FInputActionKeyMapping> testArrayActions;
TArray<FInputAxisKeyMapping> &GetAxisMappings(testArrayAxis);
TArray<FInputActionKeyMapping> &GetActionMappings(testArrayActions);
for(int i=0; i<=testArrayAxis.Num(); i++)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("Axis Array fills out"));
}
for (int i = 0; i <= testArrayActions.Num(); i++)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Action Array fills out"));
}