How to add touch screen compatibility in pygame? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to add touch screen compatibility in pygame?

I want to be able to tap the screen and make it do stuff and I can't find the syntax to get started

11th Feb 2021, 5:06 AM
Cam UOR
Cam UOR - avatar
1 Answer
+ 5
From the PyGame docs: https://www.pygame.org/docs/ref/event.html "When compiled with SDL2, pygame has these additional events and their attributes." Under which is a table in which a few events are listed. 3 of those events might be useful to you - FINGERMOTION, FINGERDOWN, FINGERUP which I'm guessing are for touchscreens. See the content under the first heading ("Pygame 2") in the following link for instructions on how to install pygame usin sld2. https://www.pygame.org/wiki/CompileUbuntu DISCLAIMER: I haven't tried out any of this. All this is information I got from the web. I apologize in advance if it isn't what you need. EDIT: Cam UOR really sorry. I saw again and the instructions for installation are only for Ubuntu. Here are the instructions for Windows: https://www.pygame.org/wiki/CompileWindows Mac: https://www.pygame.org/wiki/MacCompile
11th Feb 2021, 5:34 AM
XXX
XXX - avatar