Announcement

Collapse
No announcement yet.

Problems with GetMousePosition in Fullscreen mode.

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

    Problems with GetMousePosition in Fullscreen mode.

    By some reason on right and bottom borders of screen mouseposition returns (0,0), heres video:

    https://youtu.be/J28xSzndSF8

    #2
    eh, obs didnt capture cursor right ;(

    Comment


      #3
      ill try to recrod another video that exacly shows whut im talking about, left and bottom viewport side pixels returns x0,y0 position.

      https://www.youtube.com/watch?v=ajHi...ature=youtu.be heres video captured by geforce shadowplay and it captures cursor just correct.

      Comment


        #4
        AFAIK you get [0,0] if the mouse is outside the window. Else you will get between [1,1] and [ScreenWidth,ScreenHeight].

        Comment


          #5
          Originally posted by Jocko Jonson View Post
          AFAIK you get [0,0] if the mouse is outside the window. Else you will get between [1,1] and [ScreenWidth,ScreenHeight].
          but it happens in fullscreen mode, how the hell i can get outside the window in the fullscreen? btw i get [0,0] at top-left corner like it suppost to be, u can c it at the video. I still pretty new to engine so mb i dont understand something fundamental about screen and mouseposition inside?
          Last edited by Repin Design; 11-04-2018, 08:45 AM.

          Comment


            #6
            heres new video, this time i packed project and i got negative values on right and bottom, + they are like random once i got -622034123 on this video about on y -29, and 0 on x always,

            https://youtu.be/T2PsG1bcdE0

            Comment


              #7
              I tested it on my old 4:3 monitor and everything works just correct, but not on my main 16:9 monitor

              Comment


                #8
                Can you post the code you are getting the mouse coords with?

                Comment


                  #9
                  float mouseposx, mouseposy;
                  controller->GetMousePosition(mouseposx, mouseposy);
                  GEngine->AddOnScreenDebugMessage(-1, 3.f, FColor::Cyan, FString("X: " + FString::FromInt(mouseposx) + " Y: " FString::FromInt(mouseposy)));

                  Comment


                    #10
                    Yeah, I had the same problem a few months ago, the funny thing is that it worked perfectly when using the blueprint function instead of C++... that's the only workaround I could find.

                    Comment


                      #11
                      i need to get this done by code.

                      Comment


                        #12
                        Then I'd be happy if you can share your solution if you find one because it would also be better for my project to do it from code :/

                        Comment


                          #13
                          Just create new project and add this code to controller's tick cause i had same problem globally on every project. Btw im using 4.20, not sure about previous versions.

                          Comment


                            #14
                            Cmon guys, any ideas, i got this problem with windows10 and 4k 16:9 monitor, but not with 4:3 monitor, also it works well on my macbook air, any ideas why fullcreen isnt working right on windows with 16:9 monitor?

                            Comment


                              #15
                              Ok, i found solution, problem was not in UE, but in Windows10 settings, i used 200% desktop scale and by some reason it ruined everything, i found it out when i tried to play StarCraft and i had exac same bug there, so i changed desktop scale to 100% and now everything works just fine.
                              Last edited by Repin Design; 11-25-2018, 08:59 AM.

                              Comment

                              Working...
                              X