本文整理汇总了C++中TObjectIterator::ForceRebuildingKeyMaps方法的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator::ForceRebuildingKeyMaps方法的具体用法?C++ TObjectIterator::ForceRebuildingKeyMaps怎么用?C++ TObjectIterator::ForceRebuildingKeyMaps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TObjectIterator
的用法示例。
在下文中一共展示了TObjectIterator::ForceRebuildingKeyMaps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool UInputBlueprintLibrary::K2_RebindAxisKey(FValorAxisInputBinding OriginalBinding, FValorAxisInputBinding NewBinding)
{
UInputSettings* Settings = const_cast<UInputSettings*>(GetDefault<UInputSettings>());
if (!Settings)
{
return false;
}
TArray<FInputAxisKeyMapping>& AxisMappings = Settings->AxisMappings;
bool bFound = false;
for (FInputAxisKeyMapping& AxisKeyMapping : AxisMappings)
{
if (AxisKeyMapping.AxisName.ToString() == OriginalBinding.AxisName && AxisKeyMapping.Key == OriginalBinding.Key)
{
UpdateAxisMapping(AxisKeyMapping, NewBinding);
bFound = true;
break;
}
}
if (bFound)
{
const_cast<UInputSettings*>(Settings)->SaveKeyMappings();
for (TObjectIterator<UPlayerInput> It; It; ++It)
{
It->ForceRebuildingKeyMaps(true);
}
}
return bFound;
}