Skip to content

Handle internally generated events like user input #3050

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

You must be logged in to vote

Hi @henrySol

You probably need to dispatch the event on the specific element that contains the jsPsych experiment. When plugins use getKeyboardResponse the event listener is attached to the same element that is accessed via jsPsych.getDisplayContainerElement().

Something like the following should work:

jsPsych.getDisplayContainerElement().dispatchEvent(event);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@henrySol
Comment options

Answer selected by jodeleeuw
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