Correct way to detect swipes

1,067 views
Skip to first unread message

krister viirsaar

unread,
Feb 28, 2013, 8:38:16 AM2/28/13
to kivy-...@googlegroups.com
I had assumed detecting swipes would be easy. I found no documentation on this so I'm asking what is the correct way to detect swipes?
By Swiping I mean http://youtu.be/WZswKaYSkSo?t=14s
I need to integrate swipe into ScreenManager. Carousel is too simple.

I've found two methods, I'll call them Complex and Overkill:
1. Complex: Rip it from (for example) the Carousel widget, through these functions:
    def _get_uid(self, prefix='sv'):
   
def on_touch_down(self, touch):
   
def on_touch_move(self, touch):
   
def on_touch_up(self, touch):
   
def _do_touch_up(self, touch, *largs):

2. Overkill: Use Gesture recognition from http://kivy.org/docs/api-kivy.gesture.html

---
Extra: It would be awesome if the Screen transition would start during swipe, not after. Just like in Carousel.

Fidel N

unread,
May 14, 2014, 11:59:11 AM5/14/14
to kivy-...@googlegroups.com
While I dont share his tone, I agree with his main idea.

Is there a way to simply do swipes yet?

Im mainly afraid of having to setup an hypothetical swype in _all_ my widgets. 

Since there are layers over layers of layouts in my app, would there be a way for _any_ widget or layout to detect a swipe, or would I have to bind it to all the widgets in the app?

Thank you.

Tony Beville

unread,
Mar 8, 2015, 6:25:09 PM3/8/15
to kivy-...@googlegroups.com
Bumping this.  Newbie here, and came searching for this topic.

I have a simple working version of this that did just keeping track of touch_up and touch_down, but was wondering if there is a more standardized (or already implemented) way of doing this in kivy?  Is this something that would be best implemented as a "behavior?" 

Alexander Taylor

unread,
Mar 8, 2015, 9:16:38 PM3/8/15
to kivy-...@googlegroups.com
Probably we would be happy to accept a SwipeBehavior. It wouldn't be very hard to code.

I think the main reason it's lacking is that nobody has both needed and implemented it, not that there's a major problem with it.

Tony Beville

unread,
Mar 10, 2015, 3:17:14 PM3/10/15
to kivy-...@googlegroups.com

Thanks for the info.  If I figure out the right way to do this, I will post here!

Alexander DIY

unread,
Oct 20, 2015, 1:06:51 PM10/20/15
to Kivy users support
Any updates? :D

Rahul Ghose

unread,
Mar 19, 2016, 6:18:52 AM3/19/16
to Kivy users support
Same question here! Does kivy have any handler for swipes?

Stuart Laatsc

unread,
Jun 10, 2016, 8:24:30 PM6/10/16
to Kivy users support
https://stackoverflow.com/questions/30934445/kivy-swiping-carousel-screenmanager

Looks like right to left swiping works pretty well. I'm not sure what I would have to do to implement left to right, but it's a start.
Reply all
Reply to author
Forward
0 new messages