(C#) Use ClipCursor to block the mouse from going to a specific monitor

E

EliasYoussef47

The functions of ClipCursor and Cursor.Clip are "Confines the cursor to a rectangular area on the screen" or "Gets or sets the bounds that represent the clipping rectangle for the cursor" respectively. They do basically the same thing.So if your monitors are arranged in this way:

bef12f28-36c8-47e5-8e63-71359f331b45?upload=true.png

You can use ClipCursor to set the bounds to only monitor number 1 (the rectangle's points are (full HD monitors): left = 0, top = 0, right = 1920, bottom = 1080) and your cursor would only be able to move inside monitor number 1 and that would look like this:

7fd814af-4f74-49ad-89aa-ff7b1e8beb0e?upload=true.png

(Filled rectangle = usable monitor, not filled = outside of bounds, can't reach with mouse)

Or you can confine the cursor to monitors 1 and 2 (the rectangle's points are: left = 0, top = 0, right = 3840, bottom = 1080) and your cursor would only be able to move inside monitors number 1 and 2 and that would look like this:6d2542f1-00c3-46e0-b8be-dcf96dbc74aa?upload=true.png

You can only use a rectangle as the clip bounds, which brings me to my question: can I use ClipCursor to exclude only one monitor from the clip bounds? like so:

8081b649-959b-4f94-a2fa-14ef2f082582?upload=true.png

Continue reading...
 
Back
Top Bottom