How do I detect Mouse scroll up and down in python using pygame? I have created a way to detect it, but it doesn't give me any information about which way I scrolled the mouse as well as being terrible at detecting mouse scrolls where only 1 in 20 are getting detected.
for event in pygame.event.get():
if event.type == pygame.MOUSEWHEEL:
print("Mouse Scroll Detected.")
Any other ways I can detect mouse scrolls?
MOUSEWHEEL
event, look atevent.y
to see if you're scrolling up or down. Maybe that will account for missing events. It might be more likely that you're trying to process events in multiple places or something else. Please edit your question to include a minimal reproducible example so it's possible to assist you. – Wandering