We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48fe9a7 commit ffd2d4dCopy full SHA for ffd2d4d
pressSpace4me.m
@@ -1,18 +1,16 @@
1
function pressSpace4me
2
% Use that to stop your script and only restart when the space bar is pressed.
3
4
-fprintf('\npress space to continue\n');
+fprintf('\nPress space to continue.\n');
5
6
while 1
7
8
WaitSecs(0.1);
9
10
[~, keyCode, ~] = KbWait(-1);
11
12
- responseKey = KbName(find(keyCode));
13
-
14
- if strcmp(responseKey, 'space')
15
- fprintf('starting the experiment....\n');
+ if strcmp(KbName(find(keyCode)), 'space')
+ fprintf('starting the experiment...\n');
16
break
17
end
18
0 commit comments