Update canvas using keypresses while canvas is actively being displayed #1403
Replies: 1 comment
-
I think you'll need to modify a plugin file to be able to do this in a reasonable way. (There are possibly ways you could do it with a My approach would be to start with the jsPsych/plugins/jspsych-reconstruction.js Lines 63 to 94 in 66c8452 Lines 86-92 create the key listener, and lines 66-83 define the function that processes the key events. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Is there a way to dynamically update the size and contents of a canvas via participant keypresses while the canvas is actively being displayed? My experiment requires participants to reconstruct the size and spatial frequency of a previously-presented grating by pressing the arrow keys to modulate a grating on screen til it's the appropriate size and/or the appropriate spatial frequency. Is there a way to use the "reconstruction" plugin to modulate canvas size and contents, or is there a JSPsych plugin that can better handle this purpose?
Here's the function I use to draw the static gratings as stimuli in the "canvas-keyboard-response" plugin. I'd like the participant to be able to modulate canvas.width, canvas.height, and the cyclefactor variable live.
I'm pretty new to JSPsych and JavaScript in general, please forgive me if there's an obvious solution here. Any help is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions