| Reference | Downloads | Github

Keyboard input not working on Pavlovia

URL of experiment: Pavlovia

Description of the problem: They keyboard input (via spacebar) is not working to advance to the next screen on Pavlovia. This works on Psychopy, but not on Pavlovia. Also, strangely, it works for most screens until I get to a particular screen (screenshot attached of that screen). I tried deleting and re-inputting the keyboard component, and resyncing with Pavlovia, but no luck with it.

Here is the code of the problematic screen:

  // Initialize components for Routine "Inst10"
  Inst10Clock = new util.Clock();
  key_resp_30 = new core.Keyboard({psychoJS, clock: new util.Clock(), waitForStart: true});
  text_8 = new visual.TextStim({
    win: psychoJS.window,
    name: 'text_8',
    text: 'Great!\n\nYou are now ready to start the task.\n\nRemember to make your ratings on both of the scales as soon as you have an emotional response and to press the spacebar in order to finalize your responses.\n\nThis task should take approximately 30 minutes. Try your best to complete the task in one sitting, without interruptions.\n\nPress the spacebar to begin.',
    font: 'Arial',
    units : undefined, 
    pos: [0, 0], height: 0.04,  wrapWidth: undefined, ori: 0,
    color: new util.Color('white'),  opacity: 1,
    depth: 0.0 

Any help with be greatly appreciated,



I got rid of that screen all-together to see if the experiment will advance. It does not. So the problem seems to be that the next loop does not start. Note that this works perfectly locally (Psychopy) but is only a problem in Pavlovia.

Would love to hear if anyone has suggestions.


Hi @arkadiy, there does not seem anything wrong with your use of keyboard, but there may be an issue with your conditions file. You have a column called “Object” which is a standard built-in for JavaScript. Your “Object” column will have overwritten this object, and potentially caused a problem. Try changing the name of your columns in all of your conditions files to something else, e.g., “obj”. If that does not fix, let me know and I will take another look.

1 Like

@dvbridges thank you so very much for the suggestion!! I had no idea that JavaScript interprets Object differently- this fixed the issue.

This is a slightly different issue, but another issue that happens in translation between Python and Javascript is that something causes the markers on the sliders to look different. In Python, they are black and large, and in javascript (Pavlovia) they are small and red. Do you by any chance how I can make the markers black and larger, as they are in python?

I used the following code to make them larger and set the color to black in Psychopy, which does not seem to be translated in Javascript:


The difference in the markers is attached in two screenshots.

thank you again for all your help in getting this project running in javascript.