Hi, I have created a visual analogue scale in the PsychoPy builder. Each marker position on the sliding scale corresponds to a value 0-100. However, PsychoPy does not seem to allow you to hold down the left/right keys to move the marker along the scale. Instead, you have to press the left/right key repeatedly which means my participants may have to press it up to 50 times to get the marker to the correct position. I have read countless posts and even turned to Claude.ai and chatgpt to get help with this with no luck. (I am very new to coding). I will include my current code below which basically just allows me to use the keyboard to adjust the slider. CAN ANYONE HELP ME ADJUST MY CODE TO ALLOW KEY HOLD TO MOVE MY SLIDER? Cheers
Begin routine:
slider.markerPos = 50
Each frame:
keysPressed = event.getKeys(keyList=[‘left’, ‘right’])
for key in keysPressed:
if key == 'left':
slider.markerPos -= slider.granularity
elif key == 'right':
slider.markerPos += slider.granularity
End routine:
thisExp.addData(‘slider_rating’, slider.getRating())