我知道turtle.onscreenclick()默认为btn=1,即左键单击,但其他鼠标按钮的值是多少?我尝试使用turtle.onscreenclick(fun, 2)、(fun, "2") 和其他几种组合,但没有一个起作用。感谢您的任何反馈。
我相信这段代码是有效的:
import turtle
wn=turtle.Screen()
def newfunc(x, y):
print("Boo")
wn.onscreenclick(newfunc, 2)
(这只是一个演示,代码可以是任何东西。) 如果不起作用,那么问题一定是在你这边。