File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes Mouse pointer control Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Game Development
Reply Bookmark "Mouse pointer control" Watch "Mouse pointer control" New topic
Author

Mouse pointer control

David Miranda
Ranch Hand

Joined: Mar 14, 2005
Posts: 34
Hello,

I'm playing around with developing first-person perspective game. The player's view (look left/right/up/down) will be mouse driven. The only problem is that when the mouse pointer reaches the edge of the monitor, the mouse stops, and the rotation stops. It would be nice to be able to control the mouse pointer so that once the mouse hits the edge of the monitor, the mouse pointer can be programatically moved to the center of the screen, so that the user can continually mouse in one direction without interruption.

I'm not sure if it is possible to do this in Java...and I'm a little worried that I'll have to use jni calls to native libraries that handle this.

Anyways, my questions are:

1) Is it possible to control the pointer using standard Java libraries?
2) Is there a better way to produce this effect besides controlling the mouse?

Thanks,

David
David Miranda
Ranch Hand

Joined: Mar 14, 2005
Posts: 34
Turns out that I can use the mouseMove(int, int) method in the java.awt.Robot class
 
 
subject: Mouse pointer control
 
Threads others viewed
Mouse look
Put Cursor at the Upper Left Corner (Home Position)
help about myeclipse??
Alternate mouse control
Mapping eye movements
IntelliJ Java IDE