Way to set mouse position/continuous drag?

Is there a way to stop the mouse from moving while the RMB is held down or reset it’s position? I see there’s a lock mouse and set mouse location button but they seem to be UMG nodes and I’d like to do this without UMG. I’m using Get Mouse X and Y, which gets change in mouse position not actual position, to change camera position so I figure if I can reset the mouse position every so-often I can get a continuous drag.

You can use a gate for this. Create a vector variable for the mouse location. On tick, set the vector equal to the mouse location, but through the gate blueprint node. When rmb pressed, close the gate so the variable no longer changes. On rmb release, open the gate back up. A similar example of this is in the top down template player movement.

I need to know how to set the position on the mouse though. I can save the position on the mouse, but I don’t know where to apply that position then. I see no nodes outside of some UMG nodes that change the position of the mouse or stop it from moving.

I found out if I turn off Show Mouse Cursor in Player Controller I can have continuous drag. So I tried turning that on and off at the right time. Problem is for some reason if its turned off when RMB is clicked and held, it doesn’t work continuously on that click, I need to release and click again and it will keep moving.

That sounds like it doesn’t make sense to me, so here’s a picture;

If Right Click Held is set True, I can move the camera and if it’s set False I can use the mouse. That all works as intended. With this setup if I right click the mouse and hold the cursor disappears and I can move the camera with the mouse, but I’m still confined to the screen edges. If I release RMB and right click again quickly, before the 1 sec delay fires, I have continuous drag, even after the delay finishes and I can see the mouse again, I can continuously rotate the camera around. The mouse just stays in the corner but Get Mouse X and Get Mouse Y are still updating so the camera still moves.

I’ve tried setting Show Mouse Cursor before Set Right Click and that didn’t work either.

This link might help:
set mouse position

Thanks for the link. Looks like it has to be done in c++