I think the issue might be that you’re wanting to monitor for key lifts as well as key presses at the moment the if '3' in key_direction_resp.keys
is going to continue identifying that 3 is in the list of pressed keys even after a lift has occurred. Here are 2 possible suggestions that might help.
-
wrap a loop around your routine containing your slider and set nReps to be something huge like 1000. Set your keyboard to force end routine on press and in the End Routine tab execute your code where the slider marker is adjusted.
-
Use custom code akin to this where the code monitors if a key duration has been returned (and that key has therefore been lifted)
Hopefully this helps!
Becca