How to record two simultaneous key responses? (using Psychtoolbox)
显示 更早的评论
In my experiment design, a pair of participants should press different keys (one should press 'z', the other should press '/' on the same keyboard) to respond to the signal appearing on the same screen. But I want to know how to record two different key responses with very short time intevals.
Hope I can get some advice on how to fix the code below:
while true
[~,~,keyCode]=KbCheck;
if keyCode(KbName('z'))
endtime1=GetSecs
end
end
while true
[~,~,keyCode]=KbCheck;
if keyCode(KbName('/'))
endtime2=GetSecs
end
i=i+1;
break;
end
3 个评论
Walter Roberson
2018-11-27
what if the / is pressed first ? the second person might not realize you are waiting for them to press it again
SOJIN YU
2018-11-27
Walter Roberson
2018-11-27
in any experiment in which people are expected to do something at the same time then either person might perform the action first. Your code outline discards all inputs until it sees one particular one and then discards all inputs until it sees the other. If the second person types first your code outline would discard it because it discards everything until it sees the character expected for the first .
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!