如何在特定的瞬间获取所有原始接触点以进行点击? [英] How to get the all the raw touch points at a particular instant for a tap?

查看:87
本文介绍了如何在特定的瞬间获取所有原始接触点以进行点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

轻按一次触摸屏时,手指会因手指发胖而触摸屏幕上的多个x,y位置.但是android一次只给我一个x,y位置(例如,如果我使用adb shell getevent,它一次只给我一个xy坐标.当然,对于水龙头,自从水龙头起它就给出了多个x,y位置持续一段时间,如果xy略有变化,它会给出该时间每一部分的xy位置.)在每个瞬间,我触摸的像素超过50-100个-大概android使用某种算法将所有触摸信号减少为一个xy位置.有没有办法让我同时触摸的每个像素获得多个原始触摸信号?我有一个扎根的设备,并愿意在需要时深入研究android源代码.

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.

推荐答案

Android通过多个MotionEvent API将整个触摸区域报告为椭圆形.

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

触摸椭圆的长轴: MotionEvent. getTouchMajor()

触摸椭圆的短轴: MotionEvent. getTouchMinor()

触摸椭圆的方向: MotionEvent.getOrientation ()

这篇关于如何在特定的瞬间获取所有原始接触点以进行点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆