Integration with p5.js (jsPsych 7.0) #2469
Unanswered
matanmazor
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi JsPsych community,
[tl;dr: some keypresses are ignored in a p5 plugin when integrated with JsPsych 7.0, not 6.0]
In my experiments, I often integrate JsPsych with p5.js to create dynamic, interactive stimuli (e.g., the confidence ratings in the experiment demos here, or flickering stimuli in the experiment demos here). So far I've used JsPsych 6.0, but I'm now starting a new project and figured this was a good time to move to JsPsych 7.0.
In this new project, participants are presented with a noisy stimulus in the context of a word and need to decide whether a letter appeared in the stimulus or not. I translated my plugin to the new format and it seems to be working overall with the annoying exception that some keypresses are ignored. I noticed this only happens when you repeat a key from a previous trial, but not when you press an entirely new key. I also created a minimal version of this experiment without any stimulus at all that reproduces the problem (the relevant code lines are here). A very similar plugin, using the JsPsych 6.0 plugin format, works fine. So the problem seems to be with the integration with JsPsych 7.0.
Any idea regarding what the problem might be would be highly appreciated!
EDIT 22/01/2022: the problem seems to go away when I don't remove the p5 instance at the end of the trial (comment out line 132.) I do wonder why this worked with jsPsych 6 though!
cheers,
-Matan
Beta Was this translation helpful? Give feedback.
All reactions