Skip to content

Commit ca83c2b

Browse files
committed
make checkAbort throw an error
1 parent e6210ab commit ca83c2b

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# exclude content of logfiles folders
77
*.tsv
88
*.mat
9+
check_my_code_report.txt

CPP_getResponseDemo.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
cfg.keyboard = [];
3030
cfg.responseBox = [];
3131

32-
cfg.escapeKey = 'Escape';
32+
cfg.escapeKey = 'ESCAPE';
3333

3434
% We set which keys are "valid", any keys other than those will be ignored
3535
expParameters.responseKey = {};
@@ -68,7 +68,6 @@
6868
end
6969

7070

71-
7271
%% Run demo
7372

7473
% Create the keyboard queue to collect responses.
@@ -79,15 +78,11 @@
7978
startSecs = GetSecs();
8079
getResponse('start', cfg, expParameters, 1);
8180

82-
83-
8481
% Here we wait for 5 seconds but are still collecting responses.
8582
% So you could still be doing something else (presenting audio and visual stim) and
8683
% still collect responses.
8784
WaitSecs(5);
8885

89-
90-
9186
% Check what keys were pressed (all of them)
9287
responseEvents = getResponse('check', cfg, expParameters, 0);
9388

@@ -101,8 +96,6 @@
10196
getResponse('stop', cfg, expParameters, 1);
10297

10398

104-
105-
10699
%% Now we look what keys were pressed and when
107100
for iEvent = 1:size(responseEvents, 1)
108101

checkAbort.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function checkAbort(cfg)
1010

1111
cleanUp();
1212

13-
warning('\nEscape key press detected: aborting experiment.\n')
13+
error('Escape key press detected: aborting experiment.')
1414

1515
end
1616

getResponse.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
responseEvents = getAllKeyEvents(responseEvents, responseBox, getOnlyPress);
7979

8080
checkAbort(cfg)
81-
81+
8282
case 'flush'
8383

8484
KbQueueFlush(responseBox);

0 commit comments

Comments
 (0)