-
Notifications
You must be signed in to change notification settings - Fork 0
/
BEC_Fixation.m
24 lines (19 loc) · 931 Bytes
/
BEC_Fixation.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% This function is part of the OTG toolbox, used for generating and presenting a battery of economic choices.
% It is a convenience function used to show a fixation cross on screen (typically between trials).
function [exitflag,timestamp] = BEC_Fixation(window,exp_settings,time)
%Put fixation cross on screen
Screen('FillRect',window,exp_settings.backgrounds.fixation);
Screen('TextSize',window,exp_settings.font.FixationFontSize);
DrawFormattedText(window,'+','center','center',exp_settings.font.FixationFontColor);
timestamp = Screen('Flip',window);
%Wait until time has expired or Escape is pressed
exitflag = 0;
escapeKey = KbName('ESCAPE'); %27
[~, ~, keyCode, ~] = KbCheck(-1);
while keyCode(escapeKey) == 0 && GetSecs-timestamp < time
[~, ~, keyCode, ~] = KbCheck(-1);
end
if keyCode(escapeKey) %Proceed to exit in master
exitflag = 1;
end
end