I’m trying to use a new faster keyboard component, but it cannot get key responses correctly from the numerical keypad.
*I’m using Builder.
I set a keyboard component to end the routine when ‘num_1’ key is pressed, however, the routine did not end even when I pressed ‘num_1’ key.
On the other hand, I set a keyboard component to end the routine when ‘1’ key is pressed, and routine would end when I pressed ‘1’ key as I expected.
I guess the new keyboard component fails to get correct key names from the numerical keypad responses.
In token of that, PsychoPy returns key names such as ‘end’, ‘down’, ‘pagedown’, instead of ‘num_1’, ‘num_2’, ‘num_3’ respectively in the keyboardNEW.py demo script.
Is there any solution for this?
If I remember correctly, I could get key responses from the numerical keypad using the older version.
To get numeric input from the numerical keypad is more friendly for my participants than to get from the alphabet keys.
Thank you in advance,
Daiki
OS : Win10 PsychoPy version : 3.1.5 Standard Standalone? (y/n) : y
How to fix the problem on the numerical keypad for ver. 3.1.5 on Windows 10 (1809).
Problem: New keyboard component cannot correctly get key responses from the numerical keypad input.
Cause: The key mapping of a psychopy library (psychopy/hardware/keyboard.py) is wrong.
Cautions!! This solution makes partial changes in psychopy library. It is user’s responsibility for the use of this solution. If you’d like to avoid any failure, please wait for official fixes or updates.
Solution:
Find “keyboard.py” file in your psychopy installation directory. (typically under C:/Program Files (x86)/PsychoPy3/Lib/site-packages/psychopy/hardware for Windows10 64-bit)
Make some changes in “keyboard.py” script (from line 406 to 408), using a script editor. Make sure to open script editor as administer.
See pictures below for the before-and-after. Those are my VS Code screen.