> Ontouch might give the perception of multitouch by having a faster
> response when playing the piano, but repeats way to fast.  How do I
> make it play once for a single on touch?

The onTouchEvent method is called with a parameter that is an instance
of MotionEvent. You need to check the action of that:
http://developer.android.com/reference/android/view/MotionEvent.html#getAction%28%29

A user touching a single finger to the screen, then removing it, will
call onTouchEvent many times. There will be only one MotionEvent with
an action of ACTION_DOWN, a variable number with ACTION_MOVE (often
even if the user is trying to keep their finger still), and one with
ACTION_UP. So you would only play for an ACTION_DOWN and ignore the
rest.

Handling multitouch similarly requires checking what sort of
MotionEvent you were passed. You can read about it here:
http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html

As people have said, though, the current hardware options for running
Android have only very limited support for multitouch re accuracy and
number of fingers.

On Jul 4, 10:56 am, ArcDroid <[email protected]> wrote:
> Hi Kwan,
> How would I make it so that I can click two keys at once?
>
> Ontouch might give the perception of multitouch by having a faster
> response when playing the piano, but repeats way to fast.  How do I
> make it play once for a single on touch?
>
> Thanks
> Jake
>
> On Jul 4, 7:36 am, Kwan Cheng <[email protected]> wrote:
>
> > You can't android only tracks two touch points a time
>
> > On Jul 3, 2010 1:10 PM, "ArcDroid" <[email protected]> wrote:
>
> > Hi does anyone have good way to impliment multi touch for a piano,
> > thanks Jake
>
> > --
> > 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]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group 
> > athttp://groups.google.com/group/android-developers?hl=en

-- 
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