本文整理汇总了Python中experiment.Experiment.last_pressed方法的典型用法代码示例。如果您正苦于以下问题:Python Experiment.last_pressed方法的具体用法?Python Experiment.last_pressed怎么用?Python Experiment.last_pressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类experiment.Experiment
的用法示例。
在下文中一共展示了Experiment.last_pressed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from experiment import Experiment [as 别名]
# 或者: from experiment.Experiment import last_pressed [as 别名]
print(args)
exp = Experiment()
with Meanwhile():
#Record(pos=MousePos(), button=MouseButton())
with Parallel():
MouseRecord()
MouseCursor()
Wait(2.0)
MouseCursor("face-smile.png", (125, 125), duration=5.0)
Debug(name='Mouse Press Test')
exp.last_pressed = ''
with Loop(conditional=(exp.last_pressed!='RIGHT')):
kp = MousePress(buttons=['LEFT','RIGHT'], correct_resp='RIGHT')
Debug(pressed=kp.pressed, rt=kp.rt, correct=kp.correct)
exp.last_pressed = kp.pressed
Log(pressed=kp.pressed, rt=kp.rt)
kp = MousePress(buttons=['LEFT','RIGHT'], correct_resp='RIGHT')
Debug(pressed=kp.pressed, rt=kp.rt, correct=kp.correct)
Wait(1.0)
kp = MousePress()
Debug(pressed=kp.pressed, rt=kp.rt, correct=kp.correct)
Wait(1.0)
kp = MousePress(duration=2.0)