Using keyboard buttons to move slider direction left and right

If this template helps then use it. If not then just delete and start from scratch.

OS : Windows 10 Home Version 21 H2 OS Build 19044.1645
PsychoPy version (e.g. 1.84.x): 2020.1.2
What are you trying to achieve?: My experiment uses a slider and participants are asked to move the slider marker to various positions (either in the left or right direction). This experiment will be run online and in a scanner, so I will be using keyboard presses instead of the mouse, but am unsure how to successfully code the values 1, 2, and 3 (in builder or the coder) to indicate left, right and to confirm the selection. Is there a way to do this in the builder or can it only be done through the coder window?

What did you try to make it work?: In the coder I tried: leftKeys=‘1’, rightKeys = ‘2’, acceptKeys=‘3’)

What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information. “TypeError: init() got an unexpected keyword argument ‘leftKeys’”

Hello - I am trying to achieve the same basic thing that you described in your post. Where you able to get a keyboard-controlled slider working? If so, any chance you would be willing to share your code or info about how you set things up? Thanks very much for considering!

Absolutely! This is a screenshot from the each frame tab. In addition to this. I also created a keyboard component in the builder that has ‘1’ and ‘2’ as allowable keys. Basically the code states that clicking 2 moves the slider marker position to the left and 3 moves the slidermarker pos to the right. Granularity just represents the slider speed so feel free to customize as you wish. Hope this helps!