如何用Python点击鼠标右键?

时间:2013-12-28 18:03:42

标签: python mouse

如何使用Python单击鼠标右键? 我在互联网上搜索很多,但我找不到解决方案。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

如果您使用的是pygame,则来自http://www.nerdparadise.com/tech/python/pygame/basics/part6/

if event.type == pygame.MOUSEBUTTONDOWN:
    if event.button == 1: # left click grows radius 
        radius = min(200, radius + 1)
    elif event.button == 3: # right click shrinks radius 
        radius = max(1, radius - 1)