We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › pmouseX in mouseDragged()
Page Index Toggle Pages: 1
pmouseX in mouseDragged() (Read 1501 times)
pmouseX in mouseDragged()
Oct 16th, 2005, 1:44am
 
Hello,
I'm writing a program which creates a new object based on the velocity of the mouse when released. The problem is in mouseReleased() mouseX and pmouseX seem to be the same. This means that I needed to make a mouseDragged() method as follows:

    void mouseDragged() {
       pMouseX = pmouseX;
       pMouseY = pmouseY;
    }

and then refer to those from mouseReleased(). Is there a better way to do this?
Re: pmouseX in mouseDragged()
Reply #1 - Oct 16th, 2005, 3:52pm
 
You could just try and set a flag that gets picked up as part of the draw method. This might also save on sync issues, if any still remain?

Code:

void draw() {

if(released) {
 released = false;
 println(mouseX+": "+pmouseX);
 }
}


boolean released = false;

void mouseReleased() {
released = true;

}

Re: pmouseX in mouseDragged()
Reply #2 - Oct 16th, 2005, 6:55pm
 
i've responded to your bug report here:
http://dev.processing.org/bugs/show_bug.cgi?id=170

for the time being there's a workaround, though maybe i can get this into 0094.
Re: pmouseX in mouseDragged()
Reply #3 - Sep 12th, 2006, 9:00pm
 
now altered (fixed?) for 0116.
Page Index Toggle Pages: 1