Help! Confine cursor to a plane/ area (Fake PC monitor) Question

Hi! So i have this program where i can move the camera around with WASD. In the scene, there’s a computer in front of the camera. I want to make the cursor confined to the screen of the computer, so i can move it inside the area of a “plane” or “box” that is the monitor and make it look like you are interacting with the PC.

I am very new to Unity and couldn’t find resources on how to solve this. Any tips are appreciated!

Visual demonstration of what i’ve made so far so it’s more comprehensible: Imgur: The magic of the Internet

The easiest way would be to fake it with a UI cursor instead. Software cursors aren’t as good as hardware cursors, but there’s no built-in way to do what you want with Unity.

Alternatively, you could do the math yourself and use the actual Windows API for setting the mouse position, but that would only work on Windows (if you’re OK with that) and I personally couldn’t tell you exactly how to do it.