I set up mouse movement for my program, and when I move off the screen from the top, right, or bottom, it works great, but for whatever reason, when I move off screen to the left, the mouse coordinates jump to the right 6 pixels, and down 30 pixels (always the exact same amount).
Then if I keep moving the mouse to the left (the mouse pointer (the top left of the mouse cursor icon) is off the screen at this point, but the rest of the mouse cursor icon still remains on the screen by a few pixels) it will move it to the left where it settles at 3 pixels from the left. Weirdly enough, there are still pixels of the mouse cursor icon on the screen when it stops moving left, so it's not even the full mouse cursor icon that causes this phenomenon.
Example: If I am moving to the left of the screen and go off the screen at coordinates (0,500), it will show (0,500), but when I move to the left 1 more pixel, it will jump to the right and down and show (6,530), then I keep moving to the left and it will settle at (3,530).
I'm unsure what could cause this, but I'm using:
public class MouseManager implements MouseListener, MouseMotionListener {}
public void mouseMoved(MouseEvent e) {
mouseX = e.getX();
mouseY = e.getY();
}
Unsure why it does this (and only when moving off the left side of the screen). I'm trying to debug using both console logs with coordinates, as well as drawing a small rectangle to the screen, and both tests show the same result.