Mouse pointer and screen edge border

Hi all.
Am a newbie and this also(addition to my last topic) can be a silly question.
I'm working on my project using Mouse.move function.
Everything seems ok except one thing.

Which is
I need to restrict my mouse pointer from reaching the edge of the screen.
In other words I want to set a virtual edge offset(ed) certain amount from the real screen.

Is there a function or line of code I can use in this situation???
Any replies are welcome.

Mouse.move moves the mouse pointer relative to its current location. This means that if you don't know the starting position of the mouse pointer (as is usually the case) then you have no way of restricting which coordinates on the screen it can move to.

So there are two possible solutions:

  • Start the movements from a known position
  • Use some code that can move the mouse to absolute coordinates rather than relative

I did some research on this for a project years back and never managed to find a solution for absolute coordinates. I found some possibilities, but didn't manage to get them working, probably because I was a complete beginner at that time.

So I ended up going with a more crude solution, which worked very well for me once I got it calibrated:

There are some alternatives listed here which may be superior, I don't know.

Great thanks. Checking the link and I guess this will work.
Again thanks for sharing and best wishes for u! <3

You are welcome. I'm glad if I was able to be of assistance. Best wishes for success with your project.