hi,i know this post doesn't really match in Java2D but i didn't know where to put it else!

my question is:is it possible to restrict the mouse moving area? if yes, how?for example that the mouse pointer can't go outside the window, or even better, that the mouse pointer can't go outside a specific box inside the frame.And how to swap between "restricted mode" and "free mode"?

thanks for the idea, but it is impossible to know. i don't get the x and y variations but only the absolute pos.And when you go fast enough, you can go from the pos (50, y) to 'out of frame' in one move.So the solution isn't working fine.

It could maybe work if i knew how to get the absolute mouse coord (outside the window), but i don't know if it's possible either.Lastly, since it's not really the purpose of 'Robot', it wouldn't be a very nice solution...

Why do you care that the mouse goes outside a certain area if you can still "put it back" with the Robot as when you find out?If it is just the visual distraction of the pointer going outside your bounds, then maybe you can work around it by using a custom cursor to hide the pointer completely, then draw your own cursor that you restrict to the boundary area in your own drawing code.Anyway give a bit more info about what end effect you are after and maybe we can come up with more ideas.

Heh, that's pretty funny. I've become a bit peeved when accidentally clicking a different window in XBoing and having to rapidly switch between windows before the ball comes down again, but I expect the same happening in Quake3 would turn the air blue...

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org