(See my last post here for my solution)
I'm attempting to make the illusion of the mouse staying where it started when it was grabbed (using the hardware mouse) by storing the X,Y values and resetting after release. This seems to me like it should work, however it just doesn't reset the position…it actually doesn't set the position at all, even if I use the MouseInput.get().setCursorPosition method. Am I missing some update call or something? I know the x and y values are received correctly, it just doesn't set properly.
public void onMousePress(boolean pressed)
{
if(pressed)
{
origX = Mouse.getX();
origY = Mouse.getY();
}
else
{
Mouse.setCursorPosition(origX, origY);
}
Mouse.setGrabbed(pressed);
}