本文整理汇总了C++中FKeyEvent::GetUserIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ FKeyEvent::GetUserIndex方法的具体用法?C++ FKeyEvent::GetUserIndex怎么用?C++ FKeyEvent::GetUserIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FKeyEvent
的用法示例。
在下文中一共展示了FKeyEvent::GetUserIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyDown
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override
{
const FKey Key = InKeyEvent.GetKey();
if (Key == EKeys::Enter)
{
MenuOwner->HandleLoginUIClosed(TSharedPtr<const FUniqueNetId>(), 0);
}
else if (!MenuOwner->GetControlsLocked() && Key == EKeys::Gamepad_FaceButton_Bottom)
{
bool bSkipToMainMenu = true;
{
const auto OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
const auto IdentityInterface = OnlineSub->GetIdentityInterface();
if (IdentityInterface.IsValid())
{
TSharedPtr<GenericApplication> GenericApplication = FSlateApplication::Get().GetPlatformApplication();
const bool bIsLicensed = GenericApplication->ApplicationLicenseValid();
const auto LoginStatus = IdentityInterface->GetLoginStatus(InKeyEvent.GetUserIndex());
if (LoginStatus == ELoginStatus::NotLoggedIn || !bIsLicensed)
{
// Show the account picker.
const auto ExternalUI = OnlineSub->GetExternalUIInterface();
if (ExternalUI.IsValid())
{
ExternalUI->ShowLoginUI(InKeyEvent.GetUserIndex(), false, IOnlineExternalUI::FOnLoginUIClosedDelegate::CreateSP(MenuOwner, &FShooterWelcomeMenu::HandleLoginUIClosed));
bSkipToMainMenu = false;
}
}
}
}
}
if (bSkipToMainMenu)
{
const auto OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
const auto IdentityInterface = OnlineSub->GetIdentityInterface();
if (IdentityInterface.IsValid())
{
TSharedPtr<const FUniqueNetId> UserId = IdentityInterface->GetUniquePlayerId(InKeyEvent.GetUserIndex());
// If we couldn't show the external login UI for any reason, or if the user is
// already logged in, just advance to the main menu immediately.
MenuOwner->HandleLoginUIClosed(UserId, InKeyEvent.GetUserIndex());
}
}
}
return FReply::Handled();
}
return FReply::Unhandled();
}
示例2: OnKeyDown
FReply FSceneViewport::OnKeyDown( const FGeometry& InGeometry, const FKeyEvent& InKeyEvent )
{
// Start a new reply state
CurrentReplyState = FReply::Handled();
FKey Key = InKeyEvent.GetKey();
KeyStateMap.Add( Key, true );
//@todo Slate Viewports: FWindowsViewport checks for Alt+Enter or F11 and toggles fullscreen. Unknown if fullscreen via this method will be needed for slate viewports.
if( ViewportClient && GetSizeXY() != FIntPoint::ZeroValue )
{
// Switch to the viewport clients world before processing input
FScopedConditionalWorldSwitcher WorldSwitcher( ViewportClient );
if (!ViewportClient->InputKey(this, InKeyEvent.GetUserIndex(), Key, InKeyEvent.IsRepeat() ? IE_Repeat : IE_Pressed, 1.0f, Key.IsGamepadKey()))
{
CurrentReplyState = FReply::Unhandled();
}
}
return CurrentReplyState;
}
示例3: OnKeyUp
FReply FSceneViewport::OnKeyUp( const FGeometry& InGeometry, const FKeyEvent& InKeyEvent )
{
// Start a new reply state
CurrentReplyState = FReply::Handled();
FKey Key = InKeyEvent.GetKey();
KeyStateMap.Add( Key, false );
if( ViewportClient && GetSizeXY() != FIntPoint::ZeroValue )
{
// Switch to the viewport clients world before processing input
FScopedConditionalWorldSwitcher WorldSwitcher( ViewportClient );
if (!ViewportClient->InputKey(this, InKeyEvent.GetUserIndex(), Key, IE_Released, 1.0f, Key.IsGamepadKey()))
{
CurrentReplyState = FReply::Unhandled();
}
}
return CurrentReplyState;
}
示例4: GetUserIndex
int32 UKismetInputLibrary::GetUserIndex(const FKeyEvent& Input)
{
return Input.GetUserIndex();
}