Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:32:30+00:00 2026-06-13T00:32:30+00:00

I found this article: http://android-developers.blogspot.ca/2010/06/making-sense-of-multitouch.html which helped my understanding but I’m still not sure

  • 0

I found this article: http://android-developers.blogspot.ca/2010/06/making-sense-of-multitouch.html which helped my understanding but I’m still not sure how to do what I’m trying to do.

In my game, I have a virtual analog stick and some buttons. Only 2 fingers will ever register at once. This is what I want. One for the analog stick and one for a button.

The main thing I’m unsure of is, say I put a finger down on the analog stick and move it around, then put a finger on the button, then release the button, the analog stick should keep moving to my first finger.

And vice versa, if the button touches first and then the analog stick, if I let go of the analog stick the button should still be pushed down.

Do touch pointers work in this fashion on Android, as in, once I put my finger down, regardless of any other fingers I put up or down, it will remember my first finger in order and give it a down, move move move up events?

Thanks

Ideally I wish I had a function like this:

void onTouch(int fingerID, int action, int x, int y)
{

}

Where each finger that is put down will receive down, move and up event when that finger goes up.

The game is a racing game so they need to be able to steer and push gas at the same time.

My problem is similar to this
identified multi touch pointer in action_move

Edit:

I have this code:

private void onTouch(int finger, int action, float x, float y)
    {
        if(action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_POINTER_DOWN)
        {
            createInput(finger, x, y);
        }
        else if(action == MotionEvent.ACTION_MOVE)
        {
            inputMove(finger, x, y);
        }
        else if(action == MotionEvent.ACTION_UP  || action == MotionEvent.ACTION_POINTER_UP)
        {
            destroyInput(finger, x, y);
        }
    }

    public void onTouch(MotionEvent ev)
     {
         final int pointerCount = ev.getPointerCount();
         for (int p = 0; p < pointerCount; p++) {
             onTouch(ev.getPointerId(p), ev.getAction(), ev.getX(p), ev.getY(p));
         }
     }

But it only works for the first one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:32:31+00:00Added an answer on June 13, 2026 at 12:32 am

    So from the examples given right in the MotionEvent class:

     public boolean onTouch(MotionEvent ev) {
         final int pointerCount = ev.getPointerCount();
         for (int p = 0; p < pointerCount; p++) {
             onTouch(ev.getPointerId(p), ev.getAction(), ev.getX(p), ev.getY(p));
         }
         return true;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a Google Search, I found this article: http://docs.python.org/release/1.4/lib/node201.html Which showed examples of using
I recently found this article: http://coderjournal.com/2010/10/timing-the-execution-time-of-your-mvc-actions/ Which shows a nice little attribute that you
I found this article: http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html I created a child theme using the Twentyten theme
I've managed to setup jboss as windows service found this article http://www.jboss.org/jbossweb/install/service.html When I
i am following this tutorial: http://www.vogella.de/articles/Android/article.html#first_start but when i come to step 10.7 i
I found this article http://archive.webproasp.com/webproasp-27-20080620CompressingWebResourceaxdtoReduceYourWebsiteSize.html and it explains how to compress axd files (and
I'm trying to add Licensing to my app, and found this article:- http://developer.android.com/guide/google/play/licensing/adding-licensing.html Is
I found this great article: http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf And it works fine with CakePHP 1.2, but
I need to send Message using Facebook Graph Api. I found this article http://developers.facebook.com/docs/reference/api/message/
just was reading this article http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html And found this nice article http://wiki.apache.org/cassandra/DataModel I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.