Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Defining keypad 6 in an inline script

Hi!

For my experiment the participant has to use the keyboard to respond. There are two possible responses: "a" and "keypad 6". I'm using an inline script to define the correct_response:

if var.digit_type == 1 or var.digit_type == 3 or var.digit_type == 7 or var.digit_type == 9:
  var.correct_response = 'a' # Left response
else:
  var.correct_response = 'kp6' # Right response

The "a" works perfectly, and if I change the 'kp6' to something like 'l' it works as well. However, specifically defining the keypad 6 response doesn't work! I've tried both implementations found in "List Available Keys" such as 'kp6' and 'KP6'. Furthermore, I've also tried 'K_KP6' (the expyriment implementation, since I'm using that as a backend) or even just '6'.

The 'kp6' command does work when using the keyboard_response item, but it fails to work in an inline script. Therefore my question: how to correctly define the keypad 6 response in an inline script?

Thanks in advance!

Kind regards,

JT

Comments

  • Nevermind, I've already found the mistake I was making. I didn't change the "allowed responses". Stupid!

Sign In or Register to comment.