Response time during video display
I'm currently converting an old e-prime experiment to Opensesame and I'm struggling to handle response times during video presentations. I'm using the media_player_mpy plugin as suggested here. I found similar threads on the forum but I couldn't make it work.
The trial sequence is as follows: Fixation (keypress) - Video (1100ms; response with a keyrelease) - Blank screen (1000ms).
The video clips are exactly 1100 ms long and in each of these clips, one of two events (let's call them 'event A' and 'event B') can occur precisely at 500 ms. Participants are asked to release '1' or '2' in response to 'event A' or 'event B', respectively.
So, I'd like to record participants' response times to these events (with a timeout of 1500 ms from the 'event' onset); so responses should be possible as soon as the video starts with a timeout that overlaps with the blank screen (hope that's clear). I tried several things (e.g., setting the duration to keypress doesn't seem to record anything). Any hints on this ?
Then, I don't exactly know how to handle this 'keypress'/'keyrelease' issue ... I found this on an existing thread but I don't really know how to implement it properly in the experimental sequence ...
import pygame key = None start_time = self.time() while key == None: time = self.time() for event in pygame.event.get(): if event.type == pygame.KEYUP: key = event.key rt = time - start_time exp.set('keyreleaseRT', rt) print '%s was released after %d ms' % (key, rt)
Any advice would be greatly appreciated ! Thanks a lot !