I'm trying to track the mouse position from the moment I press left click, until I release the button. How can I achieve this ? MouseInfo for some reason registers every mouse movement (while left click is pressed) as another click.


1 2 3 4 5 | // Globally boolean pressed = false ; // In act method if (Greenfoot.mousePressed( null )) pressed = true ; else if (Greenfoot.mouseClicked( null )) pressed = false ; |
1 | if (Greenfoot.mousePressed(theActor)) ... |