mouse.getPressed() returns [1, 0, 0] even after I call event.clearEvents().
This causes a subsequent portion of the script to execute improperly. That portion is supposed to check for a mouse click and execute once it detects a click. But now the click from earlier is retained, preventing the script from executing as intended.
In particular, since the script still interprets a mouse key as being pressed, it sets getPol = 0 and thus exits the loop before win.flip() can execute. So that section of the script gets skipped and none of the intended objects get displayed.
Looking for thoughts on why event.clearEvents() would not reset the output of mouse.getPressed() to [0, 0, 0]. Other thoughts on how to get around this issue also welcome. Thank you.
event.clearEvents() getPol = 1 while getPol: win.clearBuffer() quest.draw() labelLeft.draw() labelRight.draw() scaleInst.draw() scale.draw() if event.getKeys(['escape']): print('Stopped! during judg') core.quit() if mouse.mouseMoved(): newPos = mouse.getPos() slider.pos += ( (newPos - slider.pos), 0) if slider.pos <= sliderMin: slider.pos = sliderMin elif slider.pos >= sliderMax: slider.pos = sliderMax slider.draw() event.clearEvents() a = mouse.getPressed() print a if any(mouse.getPressed()): ratingCoord = float(slider.pos) rating = float(ratingCoord - sliderMin) / float(sliderMax - sliderMin) polRating = rating getPol = 0 win.clearBuffer() win.flip()