GET Input Mode node

Node like that would make debugging shenanigans with input modes much easier.

I agree. the same applies for cinematic mode.
for some reason you can set cinematic mode, but you cant Get cinematic mode.
all of those booleans should be separate variables that you can get or set in the player controller.

having a write only variable that you can’t read doesn’t make sense.

Hello ,

I have submitted a feature request ( UE-20905 ) to the developers for further consideration. Thank you for your time and information.

Make it a great day

this is definitely needed. currently there’s no way to cache what’s the current input mode. unless you let only one class handle the input modes.

If it’s not integrated we could see it in LE Extended Standard Library perhaps?

I know this is an old post, but I needed this myself - so I came up with something like this does the trick. It is missing some information you’ll need to set the mode back later (like capture, and mouse lock), but this at least lets you know which of the 3 modes you are currently in. It returns an integer, not a mode itself.

0 = Game and UI mode
1 = UI Mode only
2 = Game mode only



// In the .h file:
    UFUNCTION(BlueprintCallable, Category = "Runtime Inspector")
        int GetCurrentViewMode(const APlayerController *PlayerController);

// In .cpp file (best in a blueprint function library)

int UMyFunctionLibrary::GetCurrentViewMode(const APlayerController *PlayerController)
{

    if (IsValid(PlayerController))
    {
        UGameViewportClient* GameViewportClient = PlayerController->GetWorld()->GetGameViewport();
        ULocalPlayer* LocalPlayer = PlayerController->GetLocalPlayer();

        bool ignore = GameViewportClient->IgnoreInput();
        EMouseCaptureMode capt = GameViewportClient->CaptureMouseOnClick();

        if (ignore == false && capt == EMouseCaptureMode::CaptureDuringMouseDown)
        {
            return 0;  // Game And UI
        }
        else if (ignore == true && capt == EMouseCaptureMode::NoCapture)
        {
            return 1;  // UI Only
        }
        else
        {
            return 2;  // Game Only
        }
    }

    return -1;

}


6 Likes