Skip to content

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

@socpite

Description

@socpite

The onKeyHold calls are under an condition that checks for timing:

                msPassed = pygame.time.get_ticks() - lastTick
                if 1000 / self.stepsPerSecond - msPassed < 1:
                    lastTick = pygame.time.get_ticks()
                    if not (self.paused or self.stopped):
                        self.callUserFn('onStep', ())
                        if len(self._allKeysDown) > 0:
                            self.callUserFn(
                                'onKeyHold',
                                (list(self._allKeysDown), list(self._modifiers)),
                            )
                        onStepEvent.send_robust(self.callUserFn, self._wrapper)
                        should_redraw = True

But the mouse events above this section of code are not. This causes undesirable behaviour for onMouseDrag and onMouseMove

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions