[SDL] SDL gesture API

Richard Tew richard.m.tew at gmail.com
Sun Mar 3 11:15:11 PST 2013

On Mon, Mar 4, 2013 at 12:11 AM, Sik the hedgehog
<sik.the.hedgehog at gmail.com> wrote:
> I don't use touch events (I don't even have touch hardware) so I can't
> comment about this. And yeah, at first glance, having that as a
> separate library indeed makes sense, especially considering all the
> kinds of gestures that could be there.

I'd like to have more accurate gesture detection and built-in support
for a standard set of gestures in SDL, in much the same way that iOS
or Android provide these things.  But the existing dollar and
multigesture support is not sufficient, and my impression was always
that it should probably be removed or upgraded.  The dollar gestures
are not accurate enough and each developer has to implement standard
gestures themselves.  I've implemented pinch and zoom according to
about five different web pages and the Android OS source code, and
obtained different and inaccurate results in various cases.  My
assumption is that having stock support for standard gestures would
ensure that different apps have a standard quality feel.

> Just a question though: doesn't the operating system handle some
> gestures on its own, i.e. it parses the movement and sends an event to
> the program with the relevant gesture? Or is that just a
> misunderstanding? (or if I'm right, is there any OS where built-in
> support for gestures is too lackluster to be worth using?)

Yes, like pinch and zoom.

> I mention this because if the OS handles gestures then a separate
> library may have it hard to reuse that functionality directly. Though
> maybe it's better to just do everything manually in the long term and
> ignore the OS when it comes to gestures (except maybe for retrieving
> user settings, but it wouldn't need SDL for that).

If I recall correctly, Android couples it's standard gesture detection
to UI widgets and the SDL display does not inherit the correct object
to make these available.  Unless I missed something, I don't think
this is a concern.


More information about the SDL mailing list