onTouch MoitonEvent getTouchMinor和getTouchMajor alwasys完全相同的号码结果,为什么?完全相同、号码、结果、MoitonEvent

2023-09-06 16:06:31 作者:谱写自己的人生

在看文档。触摸主要和次要的触摸是椭圆的触摸事件的轴线。一个是触摸区域最长测量的长度,而另一个为最短的触摸事件。像椭圆的测量

不过,我测试了这$ C $下getTouchMajor和getTouchMinor方法在几个Android平板电脑。并且这样做与把我的手指向下,使得表面积触摸屏幕会更长的一个方向,以便它不会是一个圆。以此方式,最大和最小数字不应该是相同的。

的问题是,无论是什么形状,其在触摸屏中的触摸按下事件的区域,它始终是两个完全相同的浮点数。为这是可能的唯一途径是如果手指皮肤区域接触屏幕是一个圆

所以基本上,这两个Android平板电脑我把触摸的触摸事件区域为圆形状的区域,有时更大或更小,但总能让它圈形的,没有任何设备在那里,给你一个更精确的形状?

唯一的好消息,我从这些函数得到的是触摸区域的一般大小。

为什么这两个数字相同。而这是不正确的结果?

 如果(event.getAction()== MotionEvent.ACTION_DOWN){
        浮X = event.getX();
        浮动Y = event.getY();
        浮touchMajor = event.getTouchMajor(); //椭圆触摸区域的长轴
        浮touchMinor = event.getTouchMinor(); //椭圆触摸区域的短轴

      // Toast.makeText(语境中,x+ X,Toast.LENGTH_SHORT).show();
      // Toast.makeText(背景下,Y+ Y,Toast.LENGTH_SHORT).show();
        Toast.makeText(上下文中,touchMajor+ touchMajor,Toast.LENGTH_SHORT).show();
        Toast.makeText(上下文中,touchMinor+ touchMinor,Toast.LENGTH_SHORT).show();
 

解决方案

我的项目组,我感兴趣的是同样的事情(我们发布这样的:Android手指检测 - 方向和椭圆)

我们发现暗示的意见,也许触摸屏驱动程序大多数设备不提供此数据系统。

Android TouchEvent分发

我们现在已经进行测试: 三星Galaxy S2,HTC的一个方面,Nexus 5次(LG)和Nexus 7(华硕),三星Galaxy TAP3

由于我们测试了三星Galaxy轻按3,我们最终我们得到了不同的值getTouchMajor()和getTouchMinor(),但快乐只是短暂的,因为我们发现,getTouchMajor()= getTouchMinor()* 3,在任何情况下,和getOrientation()总是0,与所有的其它设备。

我们的结论是,大多数设备不支持,getTouchMajor(),getTouchMinor()。或getOrientation()。 这是最有可能的电容触摸屏的一个限制。

方法如红外光谱(受抑全内反射)或DI(漫射照明)的基础的触摸表面,其是基于图像处理的证明,得到触摸交互的更丰富的数据。但据我们所知这些方法是在所有适用于移动技术,并没有手持设备使用任一这些

我们devasted地看到,在手持设备上这些指标的可能性无法追究。

编辑: 我只是通过共同的学生雷近日发现,这款三星生产的谷歌Nexus 10 显示了具有方向线的椭圆,当你激活输入>指针位置在开发人员设置。

这表明,我认为某些设备兑现getTouchMinor和getTouchMajor以及方向。 (或历史的相同功能的版本)。 我还没有机会对设备code自己的东西,但它似乎也合情合理。

looking at the documentation. the touch major and touch minor are axis of the ellipse for the touch event. one is for the length of the touch area longest measurement and the other for the shortest of the touch event. like the measurement of an ellipse.

however i tested this code for getTouchMajor and getTouchMinor methods on several android tablets. and did this with putting my finger down so that the surface area touching the screen would be longer in one direction so it would not be a circle. this way the max and min numbers should not be the same.

the problem is that no matter what shape the area that is touching the screen in the on touch down event, it always is the exact same float number for both. the only way for this to be possible is if the finger skin area touching the screen is a circle.

so basically, the two android tablets I have treat the touch event area of touch as a circle shaped area, sometimes larger or smaller, however always makes it circle shaped, is there any device out there that gives you a more accurate shape?

the only good information I get from these functions is the general size of the touch area.

why are both the numbers the same. and is this not the correct result?

if(event.getAction() == MotionEvent.ACTION_DOWN){
        float x = event.getX();
        float y = event.getY();
        float touchMajor = event.getTouchMajor(); // major axis of ellipse touch area
        float touchMinor = event.getTouchMinor(); // minor axis of ellipse touch area 

      //  Toast.makeText(context, "x " +  x , Toast.LENGTH_SHORT).show();
      // Toast.makeText(context, "y " +  y , Toast.LENGTH_SHORT).show();
        Toast.makeText(context, "touchMajor " + touchMajor , Toast.LENGTH_SHORT).show();
        Toast.makeText(context, "touchMinor " +  touchMinor , Toast.LENGTH_SHORT).show();

解决方案

My project group and I are interested in the same thing (we posted this: Android finger detection - Orientation and ellipse )

We have found suggestive comments that maybe the touch screen drivers for most devices do not provide this data to the system.

We have now tested: Samsung Galaxy S2, HTC One, Nexus 5 (by LG) and Nexus 7 (by Asus), Samsung Galaxy Tap3

As we tested the Samsung Galaxy Tap 3, we finally we got different values for getTouchMajor() and getTouchMinor(), but joy was only brief as we found that getTouchMajor() = getTouchMinor() * 3, in any scenario, and getOrientation() was always 0, as with all the other devices.

Our conclusion is that most devices do not support, getTouchMajor(), getTouchMinor(). or getOrientation(). This is most likely a limitation of the capacitative touch screens.

Methods such as FTIR (Frustrated Total Internal Reflection) or DI (Diffuse Illumination) based touch surfaces, which are image processing based have shown to give more rich data of the touch interaction. But as far as we know none of these methods are at all applicable on mobile technology, and no handheld device is using either of these.

We were devasted to see that the possibilities with these metrics on handheld devices cannot be pursued.

EDIT: I just recently discovered through co-students of mine, that the Samsung produced Google Nexus 10 shows an ellipse with a direction line, when you activate Input>Pointer Location under developer settings.

This indicates to me that some devices do deliver on getTouchMinor and getTouchMajor as well as orientation. (or historical versions of the same functions). I have not had the chance to code anything for the device myself but it seems plausible.