If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 2023.2.2
What are you trying to achieve?:
I am trying to use two keys to navigate left and right in a slider component. It worked perfectly in older versions with the following code:
Before Experiment:
import random
Begin Routine:
#this sets the slider to a random position in each trial
event.clearEvents('keyboard')
random_number = random.randint(1, 5)
slider.markerPos = random_number
Each Frame:
#this makes sure 'v' and 'b' can be used to navigate left and right
keys = event.getKeys()
if len(keys):
if 'v' in keys:
slider.markerPos = slider.markerPos - 1
elif 'b' in keys:
slider.markerPos = slider.markerPos + 1
I tried running it in an older version of PsychoPy, but that did not take. I can still run the experiment and still continue from, the slider using a defined keypress, but I cannot move the slider anymore. Does anyone know, why that might be the case? Also, I am getting the following error messages (since I am not very prolific in programming, I will just paste them here without knowing whether they are important or not)
184.8842 INFO Loaded monitor calibration from [‘2023_01_20 15:01’]
C:\Program Files\PsychoPy\lib\site-packages\scipy_init_.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.4
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
WARNING: pytables package not found. ioHub functionality will be disabled.
Hello from the pygame community. Contribute - pygame wiki
WARNING: pytables package not found. ioHub functionality will be disabled.