Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4844

Graphics, sound and multimedia • Missing pygame.FINGERMOTION events

$
0
0
I've connected HDMI touchscreen to Pi 4 and running the following Pygame program to detect touch events:

Code:

import pygameimport timepygame.display.init()while True:    for event in pygame.event.get():        t = event.type        if t == pygame.FINGERUP:            print(f"up x:{event.x} y:{event.y}")        elif t == pygame.FINGERDOWN:            print(f"down x:{event.x} y:{event.y}")        elif t == pygame.FINGERMOTION:            print(f"motion x:{event.x} y:{event.y}")        else:            print("unknown")    time.sleep(0.1)
It shows finger up and down events. But finger motion events printed as a series of down/up events with different coordinates. I'm trying to understand if that's a touchscreen or Pygame or KMSDRM driver problem?
Has anybody had a similar issue?
Thanks!

Statistics: Posted by peppy.player — Wed Feb 07, 2024 2:47 am



Viewing all articles
Browse latest Browse all 4844

Trending Articles