I have a problem with the mouse. I am checking for clicks inside 3 boxes using myMouse.isPressedIn(). This works, but I am doing this inside an animation and when I click the click is taken more than once. This despite the call to event.clearEvents(). If I slow things down everything is fine, but that ruins the animation. Basically is there either a way to ‘downsampling’ the reading of the mouse, or to understand why event.clearEvents() does not work as expected?
I attached a fragment of the code with the loop, each box toggles an element in the animation. Thanks!
if myMouse.isPressedIn(box1): frame1on = not frame1on elif myMouse.isPressedIn(box2): frame2on = not frame2on elif myMouse.isPressedIn(box3): frame3on = not frame3on myMouse.clickReset() event.clearEvents()