+
 新版

pygame如何检测鼠标右键点击

pksoalr 发布于 2018/06/25 19:12
阅读 3K+
收藏 1

 

pygame,如何检测右键点击,只有pygame.MOUSEBUTTONDOWN 检测鼠标点击,无法判断左键还是右键

加载中
0
h
hellshan

mouse_press = pygame.mouse.get_press()     # mouse_press对象存储一个列表分别为左键、中键、右键

mouse_press[2]就是右键

0
LintronAI
LintronAI

引用来自“hellshan”的评论

mouse_press = pygame.mouse.get_press()     # mouse_press对象存储一个列表分别为左键、中键、右键

mouse_press[2]就是右键

AttributeError: module 'pygame.mouse' has no attribute 'get_press'

0
LintronAI
LintronAI

引用来自“hellshan”的评论

mouse_press = pygame.mouse.get_press()     # mouse_press对象存储一个列表分别为左键、中键、右键

mouse_press[2]就是右键

AttributeError: module 'pygame.mouse' has no attribute 'get_press'

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部