Is there mouse locking in processing?

Is there a way to not necessarily lock the mouse in the middle of the screen, but rather make sure that it stays within a small box in the middle and when it hits the edge will just go on the other side? And of course it only can do this while a boolean is said to be true. I checked old forums and I couldn’t find anything on it, also there are no libraries i could find either.

I cant lock it in the middle because I wouldn’t be able to calculate mouse movement… or would I? please help.

Use the Robot class. You should be able to find some relevant code in the old forum.

Kf

1 Like

Or JOGL classes. Depends what renderer you’re using. Just found this searching on JOGL - http://twicetwo.com/blog/processing/2016/03/01/processing-locking-the-mouse.html

1 Like

@kfrajer can you give me a link?
@neilcsmith Im using P3D

1 Like