How to add touch screen compatibility in pygame? | Sololearn: Learn to code for FREE!


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

2/11/2021 5:06:41 AM


1 Answer

New Answer


From the PyGame docs: "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. 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: Mac: