Skip to content

Commit ffd2d4d

Browse files
committed
simplifiy pressSpaceMe
1 parent 48fe9a7 commit ffd2d4d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pressSpace4me.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
function pressSpace4me
22
% Use that to stop your script and only restart when the space bar is pressed.
33

4-
fprintf('\npress space to continue\n');
4+
fprintf('\nPress space to continue.\n');
55

66
while 1
77

88
WaitSecs(0.1);
99

1010
[~, keyCode, ~] = KbWait(-1);
1111

12-
responseKey = KbName(find(keyCode));
13-
14-
if strcmp(responseKey, 'space')
15-
fprintf('starting the experiment....\n');
12+
if strcmp(KbName(find(keyCode)), 'space')
13+
fprintf('starting the experiment...\n');
1614
break
1715
end
1816

0 commit comments

Comments
 (0)