Hello.
I’m currently having problems with mouse locking.
Currently, the mouse is locked in the viewport with the function of UE4,
Is it possible to lock the mouse in a window that even includes the title bar?
We would appreciate it if you could reply.
Thank you.
What do you mean by locking the mouse maybe I can help you…
You have in player controller the show mouse boolean and you have the function Set input UI only or something like that?
What are you exactly trying?
Thank you for your reply.
Current state
-Mouse cursor does not move out of viewport
-The mouse cursor is displayed.
What i want to do
-I want to be able to move this to the title bar of the window.
But I don’t want to move the mouse cursor out of the window.
Thank you.
Get the mouse position? I am not sure you can focus a specific widget… get mouse position and set mouse position can be your helper I guess if there is… Sorry if I did not help at all…
Thank you for your reply.
By manually setting the mouse coordinates, I was able to get closer to what I wanted to do the most.
I’m really thankful to you.
I was working on this same problem recently.
Current approach is this, though I think it still needs work:
First off, go to Edit->Project Settings->Input->Viewport Properties and set them appropriately.
I also have my Player Controller running on Tick “Set Input mode Game Only.” This should not be necessary, and definitely shouldn’t be necessary on tick, but trapping the mouse doesn’t seem to work without it.
Note that this will probably not appear to work when you use PIE (Play-In-Editor), and sometimes doesn’t work if the editor window is even open on screen so launch the game standalone or make an icon that directly launches the game without the editor to test.
Let me know how it goes, I’m very curious what you’ll find.
thank you for your reply.
I set the viewport and tried using “Set input mode to game only”, but the mouse cursor went out of the window …
thank you.