In a part of our orientation perception experiment, we first show an oriented line to the subjects then we ask them to report its orientation on the next screen. To do that I have added these lines of code in the frame.tab:
pygame.event.pump() pressed = pygame.key.get_pressed() if pressed[pygame.K_LEFT]: BO -= 1 thisExp.addData('adj_final_ori',BO) if pressed[pygame.K_RIGHT]: BO += 1 thisExp.addData('adj_final_ori',BO)
everything works fine, and I can adjust the orientation of the line when I hold down the Left or Right keys, but the problem is that some times(not always) even after releasing the key the line keeps rotating and I have to push the same key to stop it. Any Idea how to solve this problem?