%_______________________________________________________________________
%
% Configuration for running dotsExperiment
%_______________________________________________________________________
%
% Output
%
% dotInfo | configuration for random dots experiment (struct)
%_______________________________________________________________________
%
function dotInfo = createDotInfo

  dotInfo.introNumTrial = 20; % number of introduction trials per mode  
  dotInfo.numBlock = 2; % mini mini blocks per condition
  dotInfo.condTime = 540; % condition duration in seconds
  dotInfo.blockTime = dotInfo.condTime / dotInfo.numBlock; % block duration in seconds
  dotInfo.breakTime = 45; % break after blocks in seconds
  dotInfo.winSize = 4; % number of trials for short-term average accuracy
  dotInfo.longWinSize = 8; % number of trials for mid-term average accuracy
  dotInfo.minCoh = 0; % minimum coherence value
  dotInfo.maxCoh = 800; %  maximum coherence value
  dotInfo.coh = 800; % coherence starting value for introduction
  dotInfo.targetAcc = 0.75; % targeted average accuracy for task
  dotInfo.dirSet = [180, 0]; % dots in left or right direction
  dotInfo.numDotField = 1; % show a single dot patches on screen
  dotInfo.apXYD = [0 0 100]; % coordinates and diameter of aperture
  dotInfo.speed = [50]; % speed of dot motion
  dotInfo.trialtype = [2 1 1]; % reaction time, not relevant, keyboard
  dotInfo.dotSize = 2; % dot size in pixels
  dotInfo.maxDotTime = 2; % maximum duration of moving dots
  dotInfo.fixXY = [0 0]; % fixation coordinates
  dotInfo.fixDiam = 2; % fixation diameter
  dotInfo.fixColor = [255 0 0]; % red fixation dot
  dotInfo.fixMinTime = 0.75; % minimum fixation
  dotInfo.fixMaxTime = 1.25; % maximum fixation
  dotInfo.maxDotsPerFrame = 150; % depends on graphics card
  
  % Use OS X keyboard naming scheme across all plattforms
  % Otherwise LeftControl/RightControl are not recognized
  KbName('UnifyKeyNames');
  
  if ismac % Mac keyboard
    dotInfo.keyLeft = KbName('LeftGUI'); % left cmd when dots moving to left
    dotInfo.keyRight = KbName('RightGUI'); % right cmd when dots moving to right
  else % PC keyboard
    dotInfo.keyLeft = KbName('LeftControl'); % left ctrl when dots moving to left
    dotInfo.keyRight = KbName('RightControl'); % right ctrl when dots moving to right
  end
  
  dotInfo.keyModifier = KbName('LeftAlt'); % to prevent accidental input
  dotInfo.keyEscape = KbName('Escape'); % exit experiment
  dotInfo.keyReturn = KbName('Return'); % continue experiment
  
end
