Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Logging multiple key presses and duration between key presses

Hello

I am new to Python and am trying to set up an experiment in which the subject looks at an ambiguous image for a minute, and presses the left or the right key to indicate what they are seeing. I would like to collect the key presses and the timings of the key presses in a log file. I have tried to do this using pygame.event.get () and specifying the time of KEYDOWN for each press as time - t0, but am not sure how to specify both the name of the key (K_RIGHT; K_LEFT) and also the state (KEYDOWN). I would be very grateful for any help!

Thank you

Comments

Sign In or Register to comment.