Android 3 finger touch detection

前端 未结 4 606
梦谈多话
梦谈多话 2021-01-12 23:38

I am successfully able to record the coordinates of the two fingers being touched on the screen using the following code:

case MotionEvent.ACTION_MOVE:
Log.d         


        
4条回答
  •  时光取名叫无心
    2021-01-12 23:56

         firstFingerX = MotionEventCompat.getX(ev, 0); firstFingerY = MotionEventCompat.getY(ev, 0);
     if (numberOfFingers == 2) {
         Log.e("mine", "Integer: " + String.valueOf((int)MotionEventCompat.getY(ev, 1)));
         secondFingerX = MotionEventCompat.getX(ev, 1); secondFingerY = MotionEventCompat.getY(ev, 1);
     }
     if (numberOfFingers == 3) {
         Log.e("mine", "Integer: " + String.valueOf((int)MotionEventCompat.getY(ev, 2)));
         thirdFingerX = MotionEventCompat.getX(ev, 2); thirdFingerY = MotionEventCompat.getY(ev, 2);
    
     }
    

提交回复
热议问题