mousemotionlistener doesn't work right

i added both a keylistener and a mousemotionlistener to my glcanvas.
the keylistener works fine, but the mouselistener is lazy. it just creates events about 10 times per second, which is too slow.
if the canvas doesn’t have the focus, it works just fine…but the keylistener is gone.

i didn’t have this problem with gl4java+win98se

sometimes (about 1 time out of 20) the listener works correctly. why ? how to fix it ?

is the animator stealing too much cpu time, or what is going on ?

calling canvas.display() with my own thread doesn’t help.

no one had this problem ?

If you can provide a test case other people might be able to determine if it is your machine or something else.

I had the same trouble.
If you are drawing too many objects, animator sucks all cpu up, then it gets slower.
I got rid of animator.
That is what I do in MouseMotionListener shortly;

"
public void mouseDragged(MouseEvent e) {
int x = e.getX();
int y = e.getY();
Dimension size = e.getComponent().getSize();
String className = e.getSource().getClass().getName();
if (className.compareTo(“net.java.games.jogl.GLCanvas”) == 0) {
if (mouseAction == 1) {
float thetaX = 360.0f * (float) (x - prevMouseX) / (float) size.width;
float thetaY = 360.0f * (float) ( -prevMouseY + y) /
(float) size.height;
prevMouseX = x;
prevMouseY = y;

      rotateX += thetaX;
      rotateY += thetaY;
     canvas.repaint();
}

"
or, you can repaint in mouse Released.

regards.

you’re right :
if i call display() in a low-prio thread, the mouselistener works (it’s priority is 5, i think)