Skip to content Skip to sidebar Skip to footer

How To Use Multi Touch In A Python Paint Program

so im building a simple paint program in python as a project, using Pygame it works by basically drawing a stream of circles when the mouse gets pressed and you drag it around the

Solution 1:

You're going to have a difficult time if you insist on doing this in PyGame. Your best bet for multitouch in Python is Kivy, which was a very solid framework a few years ago when I used it and appears to have only gotten better since.

The disadvantage of switching to Kivy is a more complicated API, but this tutorial seems spot-on for what you're trying to do.

Solution 2:

Latest versions of pygame support multitouch input (and I believe also gestures).

The events which control it are pygame.FINGERDOWN, .FINGERUP and .FINGERMOTION. My understanding is that they work like mouse inputs, but can be multiple and can be distinguished by means of an event.finger_id property.

An example can be found here: https://www.patreon.com/posts/finger-painting-43786073?l=fr

Post a Comment for "How To Use Multi Touch In A Python Paint Program"