Infinite mouse controller camera movement



I’m not sure if it is, and I apologise in advance if this is not Cinder related question.

I would like to be able to control the camera such that when panning, rotating etc, the application continues to respond to mouse movement, even after the mouse has gone outside the bounds of the screen. At the moment the user can eg rotate the camera, but the camera stops when the mouse goes outside the bounds of the screen. Is this possible with Cinder somehow?

I don’t even know how to phrase the behavior I am looking for in a manner that google can help.

Apologies again if the solution lies in Windows™.



Good question.

I believe the Windows operating system does not send events to the application window once the mouse leaves its bounds. So this is a limitation of the OS, if I am not mistaken.

One way to work around this, is by hiding the cursor pointer, then keeping it inside the window bounds by resetting its position if it gets too close to the edge. Only do this while the mouse button is down. You don’t want to constrain a user too much.

You can use OS-specific code for this. An example implementation can be found in my old Stars sample. The link will take you to the relevant lines of code, but see also this part of the code.


Note: you may not need forceShowCursor() and forceHideCursor() because I believe Cinder’s implementation of showCursor() and hideCursor() has changed since I wrote the sample and now makes sure the cursor is shown or hidden.


That’s awesome. Thanks Paul.

#ashamed_and_must_study_the_examples_more :slight_smile: