diff --git a/plugins/jspsych-categorize-animation.js b/plugins/jspsych-categorize-animation.js index 4bdb43db17..ee2718b202 100644 --- a/plugins/jspsych-categorize-animation.js +++ b/plugins/jspsych-categorize-animation.js @@ -164,10 +164,10 @@ "key_press": e.which }; block.writeData($.extend({}, trial_data, trial.data)); - $(document).unbind('keyup', resp_func); + $(document).unbind('keydown', resp_func); } }; - $(document).keyup(resp_func); + $(document).keydown(resp_func); function endTrial() { clearInterval(animate_interval); // stop animation! diff --git a/plugins/jspsych-categorize.js b/plugins/jspsych-categorize.js index e7498e23eb..5a4fa6f989 100644 --- a/plugins/jspsych-categorize.js +++ b/plugins/jspsych-categorize.js @@ -133,14 +133,14 @@ block.writeData($.extend({}, trial_data, trial.data)); // clear function - $(document).unbind('keyup', resp_func); + $(document).unbind('keydown', resp_func); display_element.html(''); plugin.trial(display_element, block, trial, part + 1); } }; // add event listener - $(document).keyup(resp_func); + $(document).keydown(resp_func); break; case 2: diff --git a/plugins/jspsych-html.js b/plugins/jspsych-html.js index 2b080d36c4..cb5aab60d5 100644 --- a/plugins/jspsych-html.js +++ b/plugins/jspsych-html.js @@ -62,7 +62,7 @@ Example Usage: var t0 = (new Date()).getTime(); var finish = function() { if (trial.check_fn && !trial.check_fn(display_element)) return; - if (trial.cont_key) $(document).unbind('keyup', key_listener); + if (trial.cont_key) $(document).unbind('keydown', key_listener); block.writeData({ trial_type: "html", trial_index: block.trial_idx, @@ -88,7 +88,7 @@ Example Usage: var key_listener = function(e) { if (e.which == trial.cont_key) finish(); }; - $(document).keyup(key_listener); + $(document).keydown(key_listener); } }); }; diff --git a/plugins/jspsych-same-different.js b/plugins/jspsych-same-different.js index 6183d3c421..e510ecdea8 100644 --- a/plugins/jspsych-same-different.js +++ b/plugins/jspsych-same-different.js @@ -137,7 +137,7 @@ "key_press": e.which }; block.data[block.trial_idx] = $.extend({}, trial_data, trial.data); - $(document).unbind('keyup', resp_func); + $(document).unbind('keydown', resp_func); display_element.html(''); if(trial.timing_post_trial > 0) { @@ -149,7 +149,7 @@ } } }; - $(document).keyup(resp_func); + $(document).keydown(resp_func); break; } }; diff --git a/plugins/jspsych-single-stim.js b/plugins/jspsych-single-stim.js index 59ccea59ba..432313accb 100644 --- a/plugins/jspsych-single-stim.js +++ b/plugins/jspsych-single-stim.js @@ -94,7 +94,7 @@ }; block.writeData($.extend({}, trial_data, trial.data)); - $(document).unbind('keyup', resp_func); + $(document).unbind('keydown', resp_func); display_element.html(''); if (trial.timing_post_trial > 0) { setTimeout(function() { @@ -133,7 +133,7 @@ } }; - $(document).keyup(resp_func); + $(document).keydown(resp_func); // hide image if timing is set if (trial.timing_stim > 0) { diff --git a/plugins/jspsych-xab.js b/plugins/jspsych-xab.js index 68be173829..1110b20a7d 100644 --- a/plugins/jspsych-xab.js +++ b/plugins/jspsych-xab.js @@ -188,7 +188,7 @@ "key_press": e.which }; block.writeData($.extend({}, trial_data, trial.data)); - $(document).unbind('keyup', resp_func); // remove response function from keys + $(document).unbind('keydown', resp_func); // remove response function from keys display_element.html(''); // remove all xab_trial_complete = true; // move on to the next trial after timing_post_trial milliseconds @@ -201,7 +201,7 @@ } } }; - $(document).keyup(resp_func); + $(document).keydown(resp_func); break; } };