## Set up pygame screen, spot = initialize_kelpy(dimensions=(1920,1200)) if use_tobii_sim: #create a tobii simulator tobii_controller = TobiiSimController(screen) else: #create an actual tobii controller tobii_controller = TobiiController(screen) # code for when it's actually hooked up to the eye tracker tobii_controller.wait_for_find_eyetracker(3) #store tobii data in this file tobii_controller.set_data_file(data_folder + subject + '_' + session + '_' + session_time + '.tsv') #activate the first tobii eyetracker that was found tobii_controller.activate(tobii_controller.eyetrackers.keys()[0]) OFF_SOUTH = (spot.south) LID_SPOT1 = (((screen.get_width()/5) * 1)+20, (screen.get_height()/5)*3 ) LID_SPOT2 = (((screen.get_width()/5) * 4)+20, (screen.get_height()/5)*3 ) left_lid_MOVE = (((screen.get_width()/5) * 1)+20, ((screen.get_height()/6)-50)*3 ) right_lid_MOVE = (((screen.get_width()/5) * 4)+20, ((screen.get_height()/6)-50)*3 ) def present_trial(objects, probabilities, trial,i, writer): start_time = time()
OFF_LEFT = (spot.west) ############################################## ## setup and activate tobii # this creates a TobiiController that calls the actual Tobii SDK code #tobii_controller = TobiiController(screen) tobii_controller = TobiiSimController(screen) # this searches for the tobii eyetracker that is connected. # It times out based on the given amount of seconds (the default is 1,000 seconds) and exits this program #tobii_controller.wait_for_find_eyetracker(3) #set the name of the data file that will output all of the Tobii data tobii_controller.set_data_file('testdata.tsv') #activate the first tobii eyetracker that was found #tobii_controller.activate(tobii_controller.eyetrackers.keys()[0]) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Run a single trial # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def present_trial(imagepath): """ This is the main function used to run this demo. It is fed an imagepath and uses this to create a CommandableImageSprite offscreen. This Sprite is later moved onto the screen, where it hangs out until it is clicked. """ ## Images here are commandable sprites, so we can tell them what to do using Q below img = TobiiSprite( screen, spot.center, imagepath, tobii_controller, scale=IMAGE_SCALE) img.enable_follow()