Hi!
I need to modify the way of handling the mouse moves in TUER as many people find it slow. TUER is a (tiny) First Person Shooter. In order to center the cursor when it is near an edge of the screen, I use an instance of java.awt.Robot. The problem is that I assumed that when you call robot.mouseMove(x,y), it generates a single event…but that’s not the case, it’s incremental, it may generate 3 events if required, it may even generate the required event when I expect that it has already been done. Is it possible to reduce this delay? bobjob told me that he doesn’t have this problem in his FPS but he uses LWJGL and then JInput, he said that has helped him. Does JOGL contain something that might help me?
How can I do to reliably center the cursor and avoid mixing events coming from the robot and events coming from the player? I want to call getSource() on the event when MouseListener.mouseMoved(MouseEvent me) is called and then treat each event type differently. Has someone already had this problem? How did you solve it? If I only do nothing when the robot generates an event, is it enough?
My source code can be freely downloaded (watch the URL below) and the class that uses Robot is “main.GameMouseMotionController”.
P.S: I use JOGL but I don’t “troll” people using JPCT or LWJGL. I have used JOGL for my game since the start, I don’t want to “waste” some time in changing of OpenGL binding even though LWJGL is more than only an OpenGL binding.