for (const FInputAxisKeyMapping& Mapping : InputSettings->GetAxisMappings())
{
if (Mapping.AxisName == "CusMouseWheel")
{
bMouseWheel = true;
break;
}
}
if (bMouseWheel)
{
UE_LOG(LogTemp, Warning, TEXT("CusMouseWheel已存在!"));
}
else
{
AxisMapping.AxisName = "CusMouseWheel";
AxisMapping.Key = FKey("Mouse Wheel Axis");
InputSettings->AddAxisMapping(AxisMapping);
InputSettings->SaveKeyMappings();
UE_LOG(LogTemp, Warning, TEXT("CusMouseWheel添加成功!"));
}
Change to MouseX or MouseY, which can be identified as a mouse axis mapping