How to limit mouse movement to widget 3d

Hi,
I have on my scene 3d widget with a static camera, I want limit mouse movement only to this widget. I was trying to do this by overriding OnMouseMove and lock mouse, but it seems it will not work on 3d widget (?), so I made 2 scene component and clamp mouse position, and it works until the user quickly moves the mouse beyond the widget (and it also depend on framerate)
ezgif.com-gif-maker

Does anyone have any other idea how I should do this?