Capturing Mouse Input

I’ve dug around a bunch and I can’t seem to figure this one out. I do Set Show Mouse Cursor true and the mouse shows up just fine and I can interact with with UI elements, but when I set Show Mouse Cursor to false, the user must first click on the game to capture the mouse input again. This, of course, fires any input events bound to the left mouse button which is not ideal.

Is there a way to force capture the mouse without forcing the user to click on the screen again? Perhaps do a software cursor?

I have same issue, but at my end, when show mouse, it still rotates the camera until you click.

hey there,

im doing this:

whenever i set a Menu to be visible or not i call this function. I think its selfexplanatory.

regards

2 Likes

Works on way in, not not out? Strange

.

2 Likes

ehhm,

no focussing widget and you lock the mouse without a cursor?

Edit: Set Input Mode first check if your input can affect any UI, if not then fire the input ingame

Hi

Where/how do you call these variables?

well,

that is another point why i create my UI inside the PlayerController, since they belong to it anyways.
I have a GameHUDWidget created inside PC. Inside it there are other UI elements with its own hierarchy stored f.e. Menus.

So if there is an event (like Input, or Overlap) I tell the PlayerController that he might do something to this GameHUDWidget f.e. Open a Menu

If that is the case before i toggle the widgets visibility i call the func you see above. Instead of having the Hybrid Set Input Game and UI i seperate them to have more control UI only or Game only.

To answer your question in which class do you do the things you posted?

Hi

In a BP. In this case, a Block, for testing.

Thanks Brother!, it works for me

Works like a charm my friend. :ok_hand: