psychopy.org | Reference | Downloads | Github

Psychopy won't accept numpad input when eyetracker is configured

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) yes
**What are you trying to achieve?: numpad input while eyetracker is configured (SR Research, but configuring the other eyetrackers seem to do the same)

I am trying to create an experiment that requires participants to give keyboard input to a stimuli presented in a 3x3 grid - as such the numpad would be ideal. Furthermore I will be using an eyetracker to track gaze during the experiment. However configuring an eyetracker in ‘Properties’ seem to force NumLock off, independent of the keyboard button being pressed, such that input ‘left’ rather than ‘num_4’, ‘right’ rather than ‘num_6’ etc is registered once an eyetracker is configured. That would be fine, but in this case the middle numpad (num_5) will not work, as it doesn’t have a secondary function. Is there any way around this behavior?
I am guessing that there is a reason for this behavior, but I don’t know what it is.
Is there any way to assign an input to num_5 while NumLock is off, or alternatively, for configuring an eyetracker to not force NumLock to the off setting?
Pressing NumLock during the experiment has no effect. De-configruing the eye tracker (changing dropdown menu to ‘None’) will restore normal numpad function.

Thank you for reporting this issue / bug.

As of 2021.2.x, when an eye tracker is used in a Builder experiment, the keyboard.Keyboard backend is switched to use iohub instead of ptb. However, as you have found, iohub reports numpad keys differently than ptb does, so this needs to be fixed.

Unfortunately, without manually editing your python script before running the experiment, I can not think of an easy workaround for this; so it will be a high priority to get fixed.

Update: Not sure if this helps as a short term work around or not, but if NumLock is off on the keyboard, iohub should be currently mapping each numpad key to the following event key value:

1 → end
2 → down
3 → pagedown
4 → left
5 → clear
6 → right
7 → home
8 → up
9 → pageup

But this only works if NumLock is off, if it is on, then num 5 maps to an empty key as you pointed out.

Thanks a lot for the prompt reply! the work around you described does work in this instance :slight_smile: