How to get the all the raw touch points at a particular instant for a tap?

痴心易碎 提交于 2019-12-24 00:57:03

问题


When the touchscreen is tapped once, the finger touches multiple x,y positions on the screen by virtue of the finger being fat. But android only gives me one x,y position at a time (For example, if I use adb shell getevent, it gives me only one x-y coordinate at a time. Of course for a tap it gives multiple x,y positions since the tap lasts for some time and it gives the x-y position for each fraction of that time if x-y slightly changes.) At each instant there are more than 50-100 pixels that I am touching - presumably android uses some algorithm to reduce all the touch signals into one x-y position. Is there a way I can get those multiple raw touch signals at every pixel I am touching at the same time? I have a rooted device and am willing to delve into android source code if required.


回答1:


Android reports the total touch area as an ellipse through several MotionEvent APIs.

The major axis of the touch ellipse: MotionEvent.getTouchMajor()

The minor axis of the touch ellipse: MotionEvent.getTouchMinor()

The orientation of the touch ellipse: MotionEvent.getOrientation()



来源:https://stackoverflow.com/questions/18345300/how-to-get-the-all-the-raw-touch-points-at-a-particular-instant-for-a-tap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!