if slider_kbControl.markerPos is None:
# sets to our first position (or a random number?)
# and makes marker visible
slider_kbControl.markerPos = 3
#check keys (just the ones we want)
keysPressed = defaultKeyboard.getKeys(['left', 'right', 'return'])
for key in keysPressed:
if key == 'left':
slider_kbControl.markerPos -= 0.5 # subtract 0.5
elif key == 'right':
slider_kbControl.markerPos += 0.5 # add 0.5
elif key == 'return':
# confirm rating by setting to current markerPos
What specifically went wrong when you tried that?:
The slider does not work ONLINE. No marker is shown and the keyboard method for responding is not working. The response is recorded (and the routine ends) only when a mouse click happens.
Hi @wakecarter, thanks for the quick reply. I’ve had a look at your demo, but unfortunately, I get some errors concerning “slider_granularity” being not defined (I’ve basically copy-pasted your codes in my experiment.
Also, did I get it right that I just need one of the two routines in your demo (trial or iSlide)?
Sorry, I’m new to PsychoPy, and I’m really trying everything I can to make it work.
I also just discovered that the online experiments only work with the UK keyboard (not the Italian one, as left and right keys correspond to up and down). Probably that’s why I wasn’t able to make it work with all the material I previously found on this forum.