Skip to content
Discussion options

You must be logged in to vote

Hi @BastienBlain! Try this:

var XX = {
  type: "html-keyboard-response",
  stimulus: "YY",
  choices: ['rightarrow']
};

Long answer: I think you're running into two different problems here.

  1. The choices parameter must be an array, e.g. choices: ['f']. If you use a string, then jsPsych will treat the string as an array, which means that every character in the string will become a separate valid key choice. This means that using choices: 'f' (without the square brackets) will actually work as expected, even though 'f' isn't inside an array. But if you use choices: 'ArrowRight', this string will become an array: 'a','r','r','o'... etc. You can see this for yourself by using choices: 'ArrowRi…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@BastienBlain
Comment options

@BastienBlain
Comment options

@BastienBlain
Comment options

@jodeleeuw
Comment options

Answer selected by BastienBlain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1558 on February 23, 2021 20:50.