OS (e.g. Win10):
PsychoPy version (e.g. 1.84.x): 2022.2.05
I want to use the keyboard on a slider (like [here]). I implemented it as follows, but it only recorded the slider position, not the response time (i.e. first movement of slider) or the history of the slider. I marked “store rating time” and “store rating history” in the slider event. So that is not the problem.
keys = event.getKeys()
if len(keys):
if 'b' in keys:
slider_vignette.markerPos -= 1
elif 'g' in keys:
slider_vignette.markerPos += 1
slider_vignette.rating = slider_vignette.markerPos
For the rating time I tried:
keys = event.getKeys(timeStamped=True)
And then to slice like keys[0] for the response and keys[1] for the response time. I get: IndexError: list index out of range.
For the history my problem is that I want to store the position of the slider, not the keys I pressed. Therefore I am even more lost on this part.
Could you please help me out how to best solve that?