Skip to content

Conversation

@socpite
Copy link

@socpite socpite commented Nov 8, 2025

Checks timing to call mouse events.

Since there can be multiple MOUSEMOTION events in the pygame.events.get(), I've merged all of them into one.

Fix #125

Copy link
Member

@schmave schmave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for noticing this bug and taking the time to send a fix! I really appreciate it.

Is it possible to change fewer lines of code? It's always nice when there is less to retest. The code related to calling onMouseMove and onMouseDrag has to move, but could the rest of the events be left where they are?

if event.buttons == (0, 0, 0):
self.callUserFn('onMouseMove', event.pos)
else:
print("DRAG")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this print statement

@socpite
Copy link
Author

socpite commented Nov 11, 2025

  • Moved just the MouseMotion block down
  • Some new issues:
  • Currently cmu_graphics is not allowed to run on linux. If i remove the assert, it runs, but doesnt close properly with the (x) button.
  • running pip install . gives "error: package directory 'cmu_graphics/samples' does not exist". sample folder is expected to be in cmu_graphics

If the issues arent addressed yet, i will try to find out whats the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mouse drag is called more than app.stepsPerSecond times per second

2 participants