mousePressed too quick
in
Programming Questions
•
4 months ago
Hello.
I'm doing a program for my own personal interest. Basically, the problem is I have a clause for if(mousePressed) {do something} however, it passes through it 4-5 times when I want it to pass once. Obviously, this is inside the draw method.
I'll give you a code that will explain the problem.
void draw()
{if(mousePressed && mouseButton == LEFT)
{
println("here");
}
}
prints "here" around 5 times in one click. perhaps draw gets called every time way too quick while the mouse is clicked... i accept that! but, is there a simple way to cancel the effect of this?
thanks.
1