Dianne: Hahaha, okay, thanks for saving me the trouble!

Everyone: I'll do the community a huge favor and write a full-blown
tutorial on how to write multi-touch apps... IF someone will just give
me a Motorola Droid phone.  ;)  Seriously, if I had one, or any 2.0
phone that fully supports multi-touch, I'd be more than happy to test
the hell out of the MotionEvents for the new multi-touch protocol and
write a detailed how-to.

-- PJ



On Nov 11, 10:11 pm, Dianne Hackborn <[email protected]> wrote:
> I am pretty sure the emulator will not do anything intelligent with this.
> :)  I very much doubt its touch driver has even been changed to generate
> events with the new multitouch protocol.
>
>
>
>
>
> On Wed, Nov 11, 2009 at 1:27 PM, PJ <[email protected]> wrote:
> > I'm seriously considering installing a special mouse driver that
> > allows two mice at once on the screen (they do exist), and trying to
> > see if the emulator responds to simultaneous clicks as multi-touch.
> > Someone please try this and let me know if it works.  Or maybe I'll
> > get around to it in a couple of weeks...
>
> > On Nov 10, 9:06 am, "[email protected]"
> > <[email protected]> wrote:
> > > On Oct 27, 6:45 pm, Dianne Hackborn <[email protected]> wrote:
>
> > > > It's basically just some new APIs on MotionEvent:
>
> > > >http://developer.android.com/reference/android/view/MotionEvent.html
>
> > > > <http://developer.android.com/reference/android/view/MotionEvent.html
> > >Hmmm....
> > > >  and I'm not sure why, but in the doc all of those new APIs are in
> > gray, so
> > > > they should be easy to see. :)
>
> > > > Or  here is the API diff report:
>
> > > >http://developer.android.com/sdk/api_diff/5/changes.html
>
> > > >  <http://developer.android.com/sdk/api_diff/5/changes.html>I see that
> > I
> > > > didn't get around to writing documentation in MotionEvent on the way
> > > > multi-touch works; sorry about that.  Basically there are new actions
> > that
> > > > tell you when additional fingers go down and up, and each MotionEvent
> > you
> > > > receive allows you to query for the number of pointers in the event as
> > well
> > > > as the x, y, size, and pressure of each of those points (and the
> > historical
> > > > data for all those points as well if you want to collect all data since
> > the
> > > > last motion event you received).
>
> > > > So it should be pretty straight-forward.  The main thing to watch out
> > for is
> > > > the difference between the index in the current event for a pointer's
> > data
> > > > vs. the pointer ID for that pointer:
>
> > > >http://developer.android.com/reference/android/view/MotionEvent.html#.
> > ..
>
> > > > <
> >http://developer.android.com/reference/android/view/MotionEvent.html#..
> > .>The
> > > > pointer ID allows you to keep track of the individual fingers across
> > > > multiple motion events.  For example, if the user touches finger 1,
> > then
> > > > finger 2, then releases 1, then touches 1 again, you would see:
>
> > > > Finger 1 down: MotionEvent ACTION_DOWN with one pointer, whose ID is 0.
>
> > > > Finger 2 down: MotionEvent ACTION_POINTER_2_DOWN with two pointers,
> > whose
> > > > IDs are 0 and 1.
>
> > > > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID
> > is
> > > > 1.
>
> > > > Finger 1 down: MotionEvent ACTION_POINTER_1_DOWN with two pointers,
> > whose
> > > > IDs are 0 and 1.
>
> > > > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID
> > is
> > > > 1.
>
> > > > Finger 2 up: MotionEvent ACTION_UP with one pointer, whose ID is 1.
>
> > > > (And inspite of what the update documentation says, the API allows for
> > an
> > > > arbitrary number of fingers, not just 3.  I just happened to define
> > > > convenience constants for the first 3 finger down/up actions, but given
> > > > their weird naming as seen above and the finger ID mask is actually
> > 255, it
> > > > is perhaps best just to ignore those constants. :p)
>
> > > > On Tue, Oct 27, 2009 at 9:29 AM, Streets Of Boston
> > > > <[email protected]>wrote:
>
> > > > > Kind-a burried inside the blog-post on developer.android.com(http://
> > > > > developer.android.com/sdk/android-2.0-highlights.html), i saw that
> > > > > multi-touch is now supported:
>
> > > > > Android virtual keyboard
> > > > > •An improved keyboard layout to makes it easier to hit the correct
> > > > > characters and improve typing speed.
> > > > > •The ***framework's multi-touch support*** ensures that key presses
> > > > > aren't missed while typing rapidly with two fingers.
> > > > > •A smarter dictionary learns from word usage and automatically
> > > > > includes contact names as suggestions.
> > > > > <<
>
> > > > > I'm really curious how multi-touch is supported in the API.
>
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > [email protected]
>
> > > > Note: please don't send private questions to me, as I don't have time
> > to
> > > > provide private support, and so won't reply to such e-mails.  All such
> > > > questions should be posted on public forums, where I and others can see
> > and
> > > > answer them.
>
> > > Hello,
> > > Could you give me a more detailed example. I'm still not sure what is
> > > the difference between the pointer's ID and the pointer's index.
> > > Thanks!- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > 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 at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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