How can I detect if the user has double-clicked in pygame?

后端 未结 5 1482
夕颜
夕颜 2020-12-06 07:34

I know I can check if there was a left click

event.type == pygame.MOUSEBUTTONDOWN and event.button == LEFT

but how can I check if they doub

5条回答
  •  日久生厌
    2020-12-06 08:02

    There doesn't appear to be a native double-click event. I'll guess you'd need to check the time between consecutive MOUSEBUTTONDOWN events.

    The mouse wheel will generate pygame.MOUSEBUTTONDOWN events when rolled. The button will be set to 4 when the wheel is rolled up, and to button 5 when the wheel is rolled down

提交回复
热议问题