I’m trying to get to grips with the online use of psychoPy, I’ve started small with a very simple stroop task just to see if everything is in place. Currently I can get as far as the box for entering the participant ID and then instruction screen, but pressing ‘space’ doesn’t result in the experiment starting, it just hangs. The FPS counter is running, but I can’t proceed to the actual experiment.
Interestingly pressing escape will quit the experiment and takes us to the final screen. So the keyboard read is working.
I’m using psychopy 1.85.1
The website is hosted by virtualmin, so I’m assuming the required backroom stuff (php etc is available).
Hi Jon,
I am having similar issues. I created a basic program consisting of just text and keyboard.
Following the export into HTML and uploading onto a server, it just hangs after entering participant data.
I then uploaded the sample Stroop program but it also locked up on the instructions screen.
See here - www.cumultimedia.co.uk
Do you have a working ‘basic’ online test program that we can use?
Thanks
Anthony McGuffie
Hi Jon,
I am not sure if this is an error but for every project i create and convert into HTML code, the main.js file inside the vendors folder is exactly the same as the stroop demo - html\js\vendors\main.js
Thanks
Anthony McGuffie
I finally got a simple test to work. It seems that psychoJS keyboard events at present only support the left,right,up,down and escape keys. I was using my normal spacebar to respond. I also needed to change the screen units to normal and not pixel size. See here - www.cumultimedia.co.uk for my development tests.
Thanks
Ah, well done for tracking that down Anthony (sorry I’ve been running workshops the last 2 weeks and that totally absorbs my brain).
In answer to is there a simple working demo? Yes, it’s here: http://psychopy.org/demos/stroop/
so hopefully this part is fixed. Note the other known issues on the list too though (especially with not correctly using randomisation and nReps yet): https://github.com/psychopy/psychojs/issues
I believe that you can use a capitalized ‘Space’ in your keylist for a web experiment. In fact, you should be able to use any keys by using this javascript keyboard event viewer: https://w3c.github.io/uievents/tools/key-event-viewer.html
For the key codes to use, look in the “code” column under UI Events.
To make the experiment work both locally in psychoPy and on the web, include both the original psychoPy name and the javascript name. For example, use both ‘space’ and ‘Space’, or both ‘left’ and ‘ArrowLeft’.
Thanks for your input, I’m still not getting any response in the online experiment to letter key presses.
I’ve tried a number of things:
I’ve added the JAVA key codes to the responses, suggested by Jon Roberts (thanks), so in addition to ‘space’,‘r’,‘g’,‘b’ I also have ‘Space’, ‘KeyR’,‘KeyG’,‘KeyB’ in the builder response dialogue box. Yet I don’t get any movement from the initial screen - unless I press the cursor keys.
This WORKS for me, I can even save the demo-stroop version from within psychopy and upload the html to my website and this runs (with left, right, down) as responses. If I append keys: “r”,“KeyR” to the response dialogue I can’t use these keys when running, I can still use left, right, down.
So as Anthony McGuffie says, cursor keys work. But I can’t get other keys yet, I am able to work around this.
Thanks everyone.
George
p.s. By changing the answers in the .csv file to “KeyX” and adding “KeyX” to the index.html file I can get letter keys to work.
It’s a clear bug that we’ll need to get sorted (looks like Ilixa made it work for our normal examples, which typically use the cursor keys, but omitted to extend it to the full keyboard).