Added psychopy event handling