How to display pressed keyboard response to pp? #1089
Replies: 2 comments 2 replies
-
You should be able to use dynamic parameters for this: https://www.jspsych.org/overview/trial/#dynamic-parameters For your use case, you may want to find all the key codes that map to your choices, for example if you have the keyboard keys d, f, g, h, j to press for 1-5, respectively. Here's a random list of keycodes: http://gcctech.org/csc/javascript/javascript_keycodes.htm Quick adaption of the documentation example (I've not tested it so maybe won't work directly):
Though maybe you want to use the switch statement instead of many if statements, depending on how fancy you'd like to be. Hope that helps, let me know if I can clarify something :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have this very simple experiment in which participants rate words on how abstract/concrete they are (see below). Ideally, I would like them to see which number they pressed. I think this can easily be added as an additional object to the end of my timeline and then just show the key_press for 1s. Could also be fancier by keeping the scale on screen and by highlighting the selected button, but I assume that'll be a lot more work. Can anyone help me out how to do this (the simple solution is fine by me).
Below what I have now:
Beta Was this translation helpful? Give feedback.
All reactions