Dianne, Thanks for the great info. Yep looks like you just get the count of pointers and walk through that.
Now, if only there was a great trick to do multitouch on the emulator ! (I should be getting an actual phone soon though) -niko On Oct 27, 11:45 am, Dianne Hackborn <hack...@android.com> 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 > <flyingdutc...@gmail.com>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 > hack...@android.com > > 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---