SHOW:
|
|
- or go back to the newest paste.
| 1 | # Collect response | |
| 2 | responseID = 0 | |
| 3 | for i in range(NStim): | |
| 4 | responseID +=1 | |
| 5 | print responseID | |
| 6 | # Collect the response | |
| 7 | button, position, timestamp = my_mouse.get_click() | |
| 8 | # Make the cursor position relative to the window | |
| 9 | position = position[0] - winPos[0], position[1] - winPos[1] | |
| 10 | if position[0] > stimProperties[0]+Clickmargin and position[1] > stimProperties[1] + Clickmargin: | |
| 11 | exp.set("xMouseClick"+str(responseID), 'empty')
| |
| 12 | exp.set("yMouseClick"+str(responseID), 'empty')
| |
| 13 | elif position[0] > stimProperties[0]+Clickmargin and position[1] < stimProperties[1] - Clickmargin: | |
| 14 | exp.set("xMouseClick"+str(responseID), 'empty')
| |
| 15 | exp.set("yMouseClick"+str(responseID), 'empty')
| |
| 16 | elif position[0] < stimProperties[0]-Clickmargin and position[1] < stimProperties[1] - Clickmargin: | |
| 17 | exp.set("xMouseClick"+str(responseID), 'empty')
| |
| 18 | exp.set("yMouseClick"+str(responseID), 'empty')
| |
| 19 | elif position[0] < stimProperties[0]-Clickmargin and position[1] > stimProperties[1] + Clickmargin: | |
| 20 | exp.set("xMouseClick"+str(responseID), 'empty')
| |
| 21 | exp.set("yMouseClick"+str(responseID), 'empty')
| |
| 22 | else: | |
| 23 | exp.set("xMouseClick"+str(responseID), position[0])
| |
| 24 | exp.set("yMouseClick"+str(responseID), position[1]) |