-
Hi everyone, hope you are doing well! I am currently trying to figure out a way to use events that are generated by my experiment script instead of user input. What I am looking for is something like this:
I have already figured out how to set up event listeners that handle the dispatched events. But I cannot find a way to let the jspsych trial object handle the event as a user response/user input (instead of listening for actual key presses by the user). Perhaps I have to modify the relevant plugins? Any help would be greatly apreciated! Thanks in advance and enjoy your days Henry |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @henrySol You probably need to dispatch the event on the specific element that contains the jsPsych experiment. When plugins use Something like the following should work: jsPsych.getDisplayContainerElement().dispatchEvent(event); |
Beta Was this translation helpful? Give feedback.
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 viajsPsych.getDisplayContainerElement()
.Something like the following should work: