drwr wrote:"mouse capture" such as you describe isn't a good idea, interface-wise. An application shouldn't try to prevent the mouse from leaving the boundaries of the window; that will just frustrate the user.
David
Actually, for the applications often developed with Panda3d - games - it is an extremely good idea (try playing Starcraft 2 in windowed mode without cursor capture). Even though this is an old topic, it is important to me, too, for one convenience case and one very important reason:
#1 How can you, say scroll, by moving your mouse to the edge of the window in windowed mode
and more importantly:
#2 In full-screen mode with 2 monitors the mouse will move to the second monitor. Use a click to interact with the game, and the game loses focus.
Users should use alt-tab to give focus to another program.
So, if anybody found a solution to this, a reply would be much appreciated.
I believe on Windows there is the API function
- Code: Select all
ClipCursor()
to constrain and release the cursor, but it would be very nice, if Panda could release the cursor if the window in question loses focus (by alt-tabbing for example). If every developer using Panda has to do that h(im||er)self, I can smell the errors raining all day long. On Linux I am not sure, but it should be possible as, I believe, VMWare can have that behaviour.