-
Hi, Essentially, I use the What I realized I need to do is prevent the keyboard listener from starting until AFTER the stimuli are drawn (so participants can't skip through all trials during the fixation cross). I am trying to do so below, but I'm confused about how the keyboard listener works (specifically, what rts will be timelocked to).
Basically, can anyone provide any insight into how they keyboard listener works, and how to workout my timings such that I can trust that my rts are measured from stimulus onset?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @sp-conway, The RT is measured from the moment that the keyboard listener is created by calling What I would recommend is rather than trying to schedule all of the drawing events with different calls to function begin(){
draw_fixation_cross();
jsPsych.pluginAPI.setTimeout(blank_screen, fix_dur);
}
function blank_screen(){
clear_screen();
jsPsych.pluginAPI.setTimeout(draw_lines, post_fix_dur);
}
function draw_lines(){
if(n_stim == 1){
drawline1();
}
if(n_stim == 2){
drawline2();
}
if(n_stim == 3){
drawline3();
}
jsPsych.pluginAPI.getKeyboardResponse({ ... })
} I think what was happening in your code is that you were setting up three timers with the same start time. Let's say that: var fix_dur = 500;
var post_fix_dur = 1000; Then when you set this up: draw_fix_cross();
jsPsych.pluginAPI.setTimeout(clear_screen, fix_dur);
jsPsych.pluginAPI.setTimeout(drawline1, post_fix_dur); The |
Beta Was this translation helpful? Give feedback.
Hi @sp-conway,
The RT is measured from the moment that the keyboard listener is created by calling
getKeyboardResponse
.What I would recommend is rather than trying to schedule all of the drawing events with different calls to
setTimeout
you should chain together these events so that one triggers the next. For example: