How to record mouse clicks in excel with reaction time in psychopy or just python itself
I am writing a program to provide visual stimuli which are basically two tone mooney photos.
The location of the images are coming from a csv sheet, and being displayed one by one on the screen.
The images are divided in the category of face or object.
I want the user to left click if he thinks what he sees is a face and right click on a mouse if he thinks it is an object.
The left click should be recorded in an excel/csv sheet as a 'face' entry & 'right' click as an object entry. All individual participants data, should be saved in different tabs in the excel sheet.
Along with that, the response time when the click was done as soon as myWin.flip() was called, should be recorded in another column in milliseconds.
Relevant code is below:
csv input for images
trials = data.TrialHandler(
if aTrial['type'] == 'face':
try: windll.inpout32.Out32(0x0000D100, 1) myWin.flip() core.wait(0.01) windll.inpout32.Out32(0x0000D100, 0) except: print 'trigger issue found ' elif aTrial['type'] == 'object': try: windll.inpout32.Out32(0x0000D100, 2) myWin.flip() core.wait(0.01) windll.inpout32.Out32(0x0000D100, 0) except: print 'trigger issue found ' else: continue