Announcement

Collapse
No announcement yet.

Mouse cursor capture, continous axis detection, input handling

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

    Mouse cursor capture, continous axis detection, input handling

    Hello guys, I have a few issues with my RTS project, some of them are there for long long time and I finally would like to do something with them, that's why I am here

    Issue 1:

    I have bShowMouseCursor in PlayerController set to true but this causes two issues: Mouse is not locked to viewport, Axis input is detected only when some mouse button is pressed. I am looking for exactly same functionality as when bShowMouseCursor is false, just with hardware cursor visible. How is this possible ?

    SetInputModeGameAndUI does not work here. I tested it with InWidgetToFocus set to my main UMG widget, bLockMouseToViewport set to true, HideCursorDuringCapture set to false. Mouse is locked correctly, however after first mouse click it is unlocked again. Because of that I was not able to test how axis behave, maybe they are not even detected continously.

    Issue 2:

    I use minimenu for selection of active item. When I click on it, it sets active item to new one and closes itself. When I click somwhere else it should do nothing and just close. It works when I click on empty place but It does not work when I click on some other button because that buttons handles input and my minimenu does not know that there was a click.

    Click image for larger version

Name:	issuea.png
Views:	1
Size:	666.2 KB
ID:	1178958
    Click image for larger version

Name:	issueb.png
Views:	1
Size:	312.0 KB
ID:	1178959

    I was thinking about editing engine source and exposing raw mouse click events, so I can detect every mouse click. Is there some better solution ?

    #2
    Use a menu anchor to spawn the menus that pop out. They're designed to hold a menu, and will disappear when you click outside of them.

    Comment


      #3
      Originally posted by Nick Darnell View Post
      Use a menu anchor to spawn the menus that pop out. They're designed to hold a menu, and will disappear when you click outside of them.
      I do, but I checked my blueprint again and noticed that I have Focus Menu property set to false. I tried to set it true and it started working (I did not know it is needed, but yeah, I probably understand the reason. I remember I turned it off because focusing some widget blocks arrow keys). So, now I need to solve first one and I am good to go, heh

      Comment

      Working...
      X