PsychoPy version (v2021.1.4):
What are you trying to achieve?:
Trying to build a slider whose marker moves with arrow keys and people can select their answer with the RETURN key.
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 slider_kbControl.rating= slider_kbControl.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.