Recording multiple different key presses during video and logging key press and key press time
For my experiment I'm playing a video that I want to continue playing until the end (3 minutes). DURING the video I want to record all left and right arrow key presses that occur and when. I want to log whether it was a left or right arrow and at what time the key was pressed (compared to the onset of the video). Right now I have a media_player_mpy that calls Custom Python code on every key press.
The code I have now is log.write(u'time = %s' % clock.time()), but that is the time since the experiment has been running and does not give which key was pressed.