Mouselook!

Hello all, I’m an experienced C++ programmer recently switching over to Java and JOGL and I was wondering… how do you hide the mouse pointer, and how do you keep it in the center of the screen? I used to use SDL and it was done with a simple function, but now I’m clueless. I’m trying to make an FPS… and I’ve implemented the mouse look by multiplying the (mousemoveevent).getX() and .getY() with a set speed, then adding that to a position vector to get my target vector. It works PERFECTLY… but I need the mouse to reset it’s position to the center… otherwise it swings everywhere until I put the mouse back into the middle of the screen. Help? Thanks :slight_smile:

you got GraphicsDevice instance from the GraphicsConfiguration available statically… Then it can recover the DisplayMode from its running state. 8)

Hmm… now how would that give me control of the mouse pointer position?? ???

Check out java.awt.Robot

THANK YOU SOO MUCH!!! Now I just need to hide the mouse :slight_smile: I’ve read somewhere you can just change the cursor to an invisible image… I’ll try that. ;D

java.awt.Toolkit.createCustomCursor