Announcement

Collapse
No announcement yet.

GET Input Mode node

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    GET Input Mode node

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

    #2
    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.

    Comment


      #3
      Hello SinineSiil,

      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

      Comment


        #4
        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.
        Developer at AmmoboxStudios.



        Eximius ( An FPS/RTS Hybrid )

        Comment


          #5
          If it's not integrated we could see it in LE Extended Standard Library perhaps?
          Github - YouTube - Unreal Slackers - KITATUS

          Comment


            #6
            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

            Code:
            // 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;
            
            }
            Last edited by G_t_Pianoman; 11-01-2018, 09:32 PM.

            Comment

            Working...
            X