Skip to content

Wait until correct key is pressed #1241

Answered by jodeleeuw
Quinlanptq asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Philip,

You'll need to modify a plugin to do this. html-keyboard-response is probably the right starting point.

You can set the persist parameter to true on the getKeyboardResponse() method. This will allow you to gather more than one response.

var keyboardListener = jsPsych.pluginAPI.getKeyboardResponse({
callback_function: after_response,
valid_responses: trial.choices,
rt_method: 'performance',
persist: false,
allow_held_key: false

Every time a response is made it calls this function

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jodeleeuw
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants