First off, sorry for posting in this and the other thread. I was under
the impression that this thead hasn't been moderated yet. Just found
it via a search.

I informed the maker of the multitouch pong game of the problem i
encountered in his game on the droid. He was a bit surprised as he
thought he'd already solved it. Turns out the bug is also
reproduceable on the Nexus One.

I'd really love to know wheter it's my code that is doing something
stupid or the framework that has a problem somwhere. Given the logcat
output i start to suspect the later as i tried nearly everything to
get this working.

Is the description/video/source code above enough to file a bug?

On 6 Feb., 05:10, Peter Kirn <[email protected]> wrote:
> Mario,
>
> I can verify this on the two Droids I have here. (Then again, I guess
> that'd be ONE way to get two reliable pointers... yipes...)
>
> What happens on the NexusOne or other Android devices that report
> multiple pointers? My strong suspicion is that this is hardware -
> firmware related, not Android platform-related. That raises an issue
> of how even to document the problem.
>
> Peter
>
> On Jan 30, 7:49 am, Mario Zechner <[email protected]> wrote:
>
> > Hi,
>
> > i'm currently investigatingmulti-touchsupport on >= 2.0 devices,
> > testing it on a motorola milestone. Themulti-touchAPI seems to be
> > very well thought out and processing the respective MotionEvents is
> > really a piece of cake.
>
> > I want to usemulti-touchas an optional input method for a small game
> > i'm developing. The requirement is to detect 2 fingers on screen with
> > their respective x/y coordinates. Fingers will be lifted and pressed
> > down randomly and rapidly (rapidly ~ 500ms intervals). As mentioned
> > earlier, getting the data is no problem at all, here's how i do it in
> > my test application:
>
> > @Override
> >         public boolean onTouch(View v, MotionEvent event)
> >         {
> >                 int action = event.getAction();
> >             int ptrId = event.getPointerId(0);
> >             if(event.getPointerCount() > 1)
> >                 ptrId = (action & MotionEvent.ACTION_POINTER_ID_MASK) >>
> > MotionEvent.ACTION_POINTER_ID_SHIFT;
> >             action = action & MotionEvent.ACTION_MASK;
> >             if(action < 7 && action > 4)
> >                 action = action - 5;
>
> >                 if( action == MotionEvent.ACTION_DOWN )
> >                 {
> >                         for( int i = 0; i < event.getPointerCount(); i++ )
> >                         {
> >                                 float x = event.getX(i);
> >                             float y = event.getY(i);
>
> >                                 touchX[event.getPointerId(i)] = (int)x;
> >                                 touchY[event.getPointerId(i)] = (int)y;
> >                         }
>
> >                         touched[ptrId] = true;
> >                 }
> >                 if( action == MotionEvent.ACTION_MOVE )
> >                 {
> >                         for( int i = 0; i < event.getPointerCount(); i++ )
> >                         {
> >                                 float x = event.getX(i);
> >                             float y = event.getY(i);
>
> >                                 touchX[event.getPointerId(i)] = (int)x;
> >                                 touchY[event.getPointerId(i)] = (int)y;
> >                         }
> >                 }
> >                 if( action == MotionEvent.ACTION_UP )
> >                 {
> >                         touched[ptrId] = false;
>
> >                         if( event.getPointerCount() == 1 )
> >                                 for( int i = 0; i < 10; i++ )
> >                                         touched[i] = false;
> >                 }
> >                 if( action == MotionEvent.ACTION_CANCEL )
> >                 {
> >                         touched[ptrId] = false;
> >                         if( event.getPointerCount() == 1 )
> >                         for( int i = 0; i < 10; i++ )
> >                                 touched[i] = false;
> >                 }
>
> >                 return true;
> >         }
>
> > touchX[], touchY[] andtouch[] are fixed size arrays that store the
> > pointers coordinates andtouchstate. Later on i'm going to poll those
> > to react to player input.
>
> > Now, after some initial testing i noticed a problem when randomly
> > lifting and holding down 2 fingers in a random sequence. I arrived at
> > a small sequence that always let's me  reproduce the problem:
>
> > 1) (in landscape mode) hold down finger 1 on the right side of the
> > screen
> > 2) hold down finger 2 on the left side of the screen and leave both
> > fingers on the screen for a small amount of time
> > 3) now lift finger 1 and let it go down on the screen again
>
> > What happens is that logcat get's filled with
>
> > 01-30 13:06:45.702: INFO/InputDevice(1167): Dropping bad point #0:
> > newY=759 closestDy=420 maxDy=420
>
> > and the coordinates of the second finger are equal to the coordinate
> > of the other finger on a single axis.
>
> > I'm currently downloading the android source from git to maybe figure
> > out what's the problem but i'm afraid i'm not a kernel hacker enough
> > to arrive at a helpful conclusion.
>
> > Luke Hutchison posted on this list and on his web site (http://
> > lukehutch.wordpress.com/2010/01/06/my-multi-touch-code-ported-to-
> > eclair/) that he experienced similar results. The problem is also
> > reproduceable with his MTVisualizer application available in the
> > market as well as with all othermultitouchgames i could find on the
> > market. It seems that when the fingers are close on one axis the
> > hardware/driver/framework get's confused and sets one of the
> > coordinates of one of the fingers to the same value the coordinate of
> > the other finger has on this axis (Luke pointed that out in his posts,
> > i was hoping this would not be true for post G1 hardware). I wrote a
> > small sample application you can find 
> > athttp://code.google.com/p/android-gamedev/source/browse/trunk/src/com/...
> > and prepared a video to show the problem:
>
> >http://www.youtube.com/watch?v=bvqX4EkpbNI
>
> > I'm not entirely sure wheter there's abugin thecodeor wheter it is
> > hardware/driver related. I'd be very thankful for any comments on the
> > matter as the behaviour as shown in the video doesn't allow formulti-
> >touchcontrols of games as seen for example in iphone games as
> > minigore.
>
> > Thanks for reading,
> > Mario

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to