Android Multitouch Question

Hello, I am struggling with multitouch.

The first event I get is SDL_FINGERDOWN, expected with an fingerId of 0

Then I move around and get SDL_FINGERMOTION as next event. But here I get a fingerId of 278.

I thought these Ids should match as it was the same finger I moved around?

Thx
andreas

Are you sure you aren’t touching the screen with 278 fingers? :stuck_out_tongue:

Jonny DOn Wed, Nov 30, 2011 at 7:26 AM, akr <a.kindlbacher at gmx.de> wrote:

**
Hello, I am struggling with multitouch.

The first event I get is SDL_FINGERDOWN, expected with an fingerId of 0

Then I move around and get SDL_FINGERMOTION as next event. But here I get
a fingerId of 278.

I thought these Ids should match as it was the same finger I moved around?

Thx
andreas


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

Are the other data for the motion event correct? Could it be swapping
fingerId with x, y, pressure, touch radius or something like that?
When you receive the down event, is there another parameter with the
same value as the motion event’s fingerId?On 30 November 2011 07:26, akr <a.kindlbacher at gmx.de> wrote:

Hello, I am struggling with multitouch.

The first event I get is SDL_FINGERDOWN, expected with an fingerId of 0

Then I move around and get SDL_FINGERMOTION as next event. But here I get a
fingerId of 278.

I thought these Ids should match as it was the same finger I moved around?

Is solved now. I did something like that which was the problem:

event.button.x=event.tfinger.y…

to be compatible to the old code…

But now it looks l am in trouble with the events generated by SDLActivity.java

When I compile the testgesture.c on mac everything worx fine. Two fingers get
displayed independendly from each other like charm.

On Android it seems that the y corrdinate the java activity sends from a finger
affects the other finger.

Means when I move finger 2 in y direction the y corrdinate from finger 1 is also
changing…very strange. This is only the case when 2 fingers are at about the
same height on the screen.

Having one finger in lower left and the other in upper right corner (landscape)
my sprites move like charm. Independendly from each other.

Any ideas? Has anyone a better code than the one from the java file sending events
to native?

andreas

Means when I move finger 2 in y direction the y corrdinate from finger 1 is
also changing…very strange. This is only the case when 2 fingers are
at about the same height on the screen.

That is strange, I would suggest adding some logging in SDLActivity.java,
specifically in the onTouch function to log what the Java side is getting as
coordinates for each touch (log finger index, x and y coordinates), then
compare that with what SDL is giving you in your app. This is to rule out some
Android (or even physical) issue that may be causing this problem.

Gabriel.

Den 01. des. 2011 07:21, skrev akr:

Means when I move finger 2 in y direction the y corrdinate from finger 1 is also
changing…very strange. This is only the case when 2 fingers are at about the
same height on the screen.

Having one finger in lower left and the other in upper right corner
(landscape)
my sprites move like charm. Independendly from each other.

This sounds like a hardware issue. It’s pretty common on lower end
Android phones (my own is the same way). They don’t have true
multitouch, and get confused when the axes of two fingers cross. It’s
sometimes called “1.5 fingers multitouch”

Try this: Move one finger from lower left to upper left while
simultaneously moving another finger from upper right to lower right. On
my phone, when the y positions get close, they slow down and then move
back the way they came, away from where your fingers are moving.

It sucks, but since it’s a hardware problem there’s unfortunately
nothing you can do to fix it. Sorry.

-g

Gerry Jo Jellestad wrote:

Den 01. des. 2011 07:21, skrev akr:

Means when I move finger 2 in y direction the y corrdinate from finger 1 is also
changing…very strange. This is only the case when 2 fingers are at about the
same height on the screen.

Having one finger in lower left and the other in upper right corner

(landscape)

my sprites move like charm. Independendly from each other.

This sounds like a hardware issue. It’s pretty common on lower end
Android phones (my own is the same way). They don’t have true
multitouch, and get confused when the axes of two fingers cross. It’s
sometimes called “1.5 fingers multitouch”

Try this: Move one finger from lower left to upper left while
simultaneously moving another finger from upper right to lower right. On
my phone, when the y positions get close, they slow down and then move
back the way they came, away from where your fingers are moving.

It sucks, but since it’s a hardware problem there’s unfortunately
nothing you can do to fix it. Sorry.

-g


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

Thats exactly the problem!!! Are u sure thats a hardware limitation or is that fixed in a higher SDK than 2.0?

andreas

Message-ID: <1322996711.m2f.31004 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Gerry Jo Jellestad wrote:

Den 01. des. 2011 07:21, skrev akr:
This sounds like a hardware issue. It’s pretty common on lower end
Android phones (my own is the same way). They don’t have true
multitouch, and get confused when the axes of two fingers cross. It’s
sometimes called “1.5 fingers multitouch”

Thats exactly the problem!!! Are u sure thats a hardware limitation or is that fixed in a higher SDK than 2.0?

It’s hardware. It isn’t a bug, but instead a limitation. That having
been said, you might be able to write a software layer that detects
when this is happening, and tries to correct things accordingly.

Maybe something that gives each finger an offset that grows larger the
closer that finger is to other fingers, or a layer to detect changes
that happen TOO quickly (or both), depending on the details of your
problem.

If this does work then it might not work perfectly, but it should be
better than nothing.> Date: Sun, 04 Dec 2011 03:05:12 -0800

From: “akr” <a.kindlbacher at gmx.de>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Android Multitouch Question

Jared Maddox wrote:>

Date: Sun, 04 Dec 2011 03:05:12 -0800
From: “akr” <@akr>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Android Multitouch Question
Message-ID: <1322996711.m2f.31004 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Gerry Jo Jellestad wrote:

Den 01. des. 2011 07:21, skrev akr:
This sounds like a hardware issue. It’s pretty common on lower end
Android phones (my own is the same way). They don’t have true
multitouch, and get confused when the axes of two fingers cross. It’s
sometimes called “1.5 fingers multitouch”

Another finding:

A friend of mine has a tablet. I think 1280x800, Android 3.x.

Multitouch works much better there. No limitations. Seems to be as good as iOS multitouch!!!
Thats exactly the problem!!! Are u sure thats a hardware limitation or is that fixed in a higher SDK than 2.0?

It’s hardware. It isn’t a bug, but instead a limitation. That having
been said, you might be able to write a software layer that detects
when this is happening, and tries to correct things accordingly.

Maybe something that gives each finger an offset that grows larger the
closer that finger is to other fingers, or a layer to detect changes
that happen TOO quickly (or both), depending on the details of your
problem.

If this does work then it might not work perfectly, but it should be
better than nothing.


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