Android multi-touch progress?

Hey guys,

I was just wondering where multi-touch support was at for Android. Peyla’s version was unstable, from what I remember the official release doesn’t support it at all (yet). Any progress?

I think current SDL state supports multitouch events in AndroidOn Sun, Nov 6, 2011 at 10:54 AM, wilbefast wrote:

Hey guys,

I was just wondering where multi-touch support was at for Android. Peyla’s
version was unstable, from what I remember the official release doesn’t
support it at all (yet). Any progress?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

El 06/11/2011 05:54, “wilbefast” escribi?:

Hey guys,

I was just wondering where multi-touch support was at for Android.
Peyla’s version was unstable, from what I remember the official release
doesn’t support it at all (yet). Any progress?

It’s fully working in HG, I’ve been using it for at least a couple of
months.

Hmm - do you know how? Up till now I’ve been using SDL_MOUSEBUTTONDOWN and SDL_GetMouseState, a function that doesn’t treat multiple pointing devices.

Try checking the documentationfor SDL_TouchFingerEvent (generated by
SDL_FINGERMOTION, SDL_FINGERDOWN, etc)On Sun, Nov 6, 2011 at 2:45 PM, wilbefast wrote:

Hmm - do you know how? Up till now I’ve been using SDL_MOUSEBUTTONDOWN and
SDL_GetMouseState, a function that doesn’t treat multiple pointing devices.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You might want to have alook at a multitouch module I created for a game engine I’m working on. It’s working well:
http://code.google.com/p/bennugd-monolithic/source/browse/trunk/modules/mod_multi/mod_multi.c

Nice one :slight_smile: I’ll need to upload the code to my phone to test out the events - they’re never generated on Linux (unsurprising). Since I’m trying to support both (single and multi-touch systems) in the same framework the mouse will need to be wrapped and interpreted as finger number 0… I prophesise some tricky stuff ahead… Still, good to know it’s possible :smiley: I’ll have a mess around with it - especially josebagar’s example (I learn best reading source code).

Actually needed a newer version from Mercurial to use finger events - found this out quite by accident while getting a patch for access to APK files. Trouble is I’m now no longer get touches as mouse events :?

Before I had:

Code:
while (SDL_PollEvent(&event))
{
switch (event.type)
{

       //  ... stuff

        case SDL_MOUSEBUTTONDOWN:
            interface->clicking = true;
            break;

        case SDL_MOUSEBUTTONUP:
            interface->clicking = false;
            break;

        default:
            break;
    }
}

if(interface->clicking)
    //SDL_GetMouseState(&interface->last_touch.x, &interface->last_touch.y);

I can add SDL_FINGERDOWN and SDL_FINGERUP to the switches cases, but as for getting the last position of the finger… is the anything analogous to SDL_GetMouseState for fingers?