• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mouse pointer control

 
David Miranda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turns out that I can use the mouseMove(int, int) method in the java.awt.Robot class
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!