0
我需要运行一个测试,在测试过程中主体能够用键盘旋转一条线。psychopy,用键盘改变poligon特征
我一直在寻找很多,但我还没有找到一个好的答案。
到目前为止,我已经试过这样:
p = 0
polygon = visual.Line(
win=win,
name='polygon',
units='cm',
start=(-(2, 0.5)[0]/2.0, 0),
end=(+(2, 0.5)[0]/2.0, 0),
ori=p,
pos=(0, 0),
lineWidth=1,
lineColor=[1,1,1],
lineColorSpace='rgb',
fillColor=[1,1,1],
fillColorSpace='rgb',
opacity=1,
depth=0.0,
interpolate=True
)
while True:
resp_key = event.waitKeys(keyList=['n','m','return'])
if resp_key == 'n':
p = p-1
elif resp_key == 'm':
p = p+1
elif resp_key == 'return':
break
谢谢!