You might also consider just leaving the cursor visible, so the user
can see for himself when he is at the edge of the screen.
On 9 Mar 2006, at 02:37, email@hidden wrote:
There are lots of situations where you want to use the mouse for
something other than controlling the cursor on the screen. For
example, 3D object viewers often use the mouse to rotate your
viewpoint, or a game might use the mouse to steer a spaceship.
I'm trying to figure out how to implement this in Java. To a
first approximation, it's simple. Call Toolkit.createCustomCursor()
to create an invisible cursor. Set that as the cursor on your window.
Now just listen for mouse moves and drags, and respond to them
appropriately.
The problem is that you're still really just moving a cursor on
the screen. You stop getting mouse move events as soon as the mouse
leaves the window. Mouse drag events keep coming, but the cursor is
still limited to the screen dimensions. So you're flying your
spaceship, and suddenly hit a wall! No, it isn't a force field in
space. :) The cursor has just run into the edge of the screen.
Obviously native applications manage to find a way around this
problem. Does anyone know a way to do it from Java?
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden