mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 16:18:11 +00:00
require key to be released before continuing in getKeyboardResponse
This commit is contained in:
parent
3c70abc3aa
commit
94446016ae
17
jspsych.js
17
jspsych.js
@ -673,10 +673,19 @@
|
||||
core.cancelKeyboardResponse(listener_id);
|
||||
}
|
||||
|
||||
callback_function({
|
||||
key: e.which,
|
||||
rt: key_time - start_time
|
||||
});
|
||||
var after_up = function(up) {
|
||||
|
||||
if(up.which == e.which) {
|
||||
$(document).unbind('keyup', after_up);
|
||||
|
||||
callback_function({
|
||||
key: e.which,
|
||||
rt: key_time - start_time
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).keyup(after_up);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user