I’m making a world-renderer using JOGL, which lets you aim (heading) with the mouse. To get mouse-movement data, I implemented a layer on top of the AWT which I can poll() and then use methods like Mouse.getDiffX/Y().
On MS Windows this seems to work fine, but Linux seems to return scewed acceleration-data.
The source-code for the implementation is:
public final void mouseMoved(MouseEvent event)
{
this.mouseMotion(event);
}
public final void mouseDragged(MouseEvent event)
{
this.mouseMotion(event);
}
private final void mouseMotion(MouseEvent event)
{
if (Mouse.ignoreNextMove)
{
Mouse.ignoreNextMove = false;
return;
}
// add the acceleration to the diff
Mouse.xDiff += event.getX() - Mouse.component.getWidth() / 2;
Mouse.yDiff += event.getY() - Mouse.component.getHeight() / 2;
// set mouse at center of component using Robot class
// which fires a to be ignored motion-event
Mouse.ignoreNextMove = true;
Mouse.resetMouse();
}
In the Mouse class:
public static final void poll()
{
xLastDiff = xDiff;
yLastDiff = yDiff;
xDiff = 0;
yDiff = 0;
}
public static final int getDiffX()
{
return xLastDiff;
}
public static final int getDiffY()
{
return yLastDiff;
}
So the problem is: why does this work like a charm on Windows, and results in unpredictable behaviour on Linux?
Oh, and I really want to do this with AWT, so please don’t start about JInput 
(JInput throws an ArrayIndexOutOfBoundsException inside ContrlEnv.getControllers() …)
The trimmed-renderer is webstartable and can be found at:
Any feedback on the behaviour is really appreciated as I don’t run Linux myself 
- Skippy
