ppizarror / pygame-menu

A menu for pygame. Simple, and easy to use
https://pygame-menu.readthedocs.io/
Other
544 stars 141 forks source link

Touchscreen on PiTFT without mouse not working #424

Closed asztalosdani closed 1 year ago

asztalosdani commented 1 year ago

Environment information

Describe the bug Running a menu with mouse_visible=False does not work on a Raspberry with a PiTFT touchscreen.

To Reproduce I copied the menu from the quickstart guide, and added mouse_visible=False.

Expected behavior The menu does not react to any touch events.

Additional context If I set mouse_visible=True it works as expected, but I want to disable the cursor. The mouse events are correctly triggered if I print them using

events = pygame.event.get()
for event in events:
    if event.type == pygame.QUIT:
        exit()
    if event.type == pygame.MOUSEMOTION:
        print(pygame.mouse.get_pos())
    if event.type == pygame.MOUSEBUTTONDOWN:
        print(pygame.mouse.get_pressed())

The touchscreen and touchscreen_motion_selection make no difference, but I'm not sure they should as they are only for pygame 2 right?

ppizarror commented 1 year ago

Hi! I'll take a look at this issue asap!

ppizarror commented 1 year ago

Does #427 solves your issue?

asztalosdani commented 1 year ago

Yes, thanks!

ppizarror commented 1 year ago

Nice. I'll publish v4.3.0 to pypi today