Multi-touch on Milestone with SDK 2.0

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Multi-touch on Milestone with SDK 2.0

Postby steff@MA » Mon Jan 04, 2010 11:59 am

Hi everyone,

I'm working on something which I used to consider easy. I'd like to send finger/touch positions over the network. It works fine for a single finger/touch. But I am not really able to implement it properly for multiple fingers (i.e. I am aware that the Milestone is only able to distinguish between 2 fingers).

What I want to do is sending every movement's position and provide it with a pointer id. What if been doing so far can be seen in this snippet:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. int tap_count = event.getPointerCount();
  2.  
  3. switch (event.getAction()) {
  4.  
  5. case MotionEvent.ACTION_DOWN:
  6.  
  7.         msg.addArgument("TOUCHES_BEGAN:java.lang.String:TOUCHES_BEGAN;TAP_COUNT:java.lang.Integer:"+tap_count);
  8.  
  9.         //squidyview.invalidate();
  10.  
  11.         break;
  12.  
  13. case MotionEvent.ACTION_MOVE:
  14.  
  15.         msg.addArgument("TOUCHES_MOVED:java.lang.String:TOUCHES_BEGAN;TAP_COUNT:java.lang.Integer:"+tap_count);
  16.  
  17.         //squidyview.invalidate();
  18.  
  19.         break;
  20.  
  21. case MotionEvent.ACTION_UP:
  22.  
  23.         msg.addArgument("TOUCHES_ENDED:java.lang.String:TOUCHES_BEGAN;TAP_COUNT:java.lang.Integer:"+tap_count);
  24.  
  25.         //squidyview.invalidate();
  26.  
  27.         break;
  28.  
  29. case MotionEvent.ACTION_CANCEL:
  30.  
  31.         msg.addArgument("TOUCHES_CANCELED:java.lang.String:TOUCHES_BEGAN;TAP_COUNT:java.lang.Integer:"+tap_count);
  32.  
  33.         //squidyview.invalidate();
  34.  
  35.         break;
  36.  
  37. default:
  38.  
  39.         msg.addArgument("");
  40.  
  41.         break;
  42.  
  43. }
  44.  
  45.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4

(btw: should I uncomment the invalidate() call for the corresponding View?)

So where am I going to implement multitouch capability? And help would be great.
Thanks in advance
steff@MA
Junior Developer
Junior Developer
 
Posts: 20
Joined: Fri Nov 27, 2009 5:14 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests