开发者

X Axis Sensor Correction - Flipped Sensor Detection - Froyo

开发者 https://www.devze.com 2023-01-19 18:49 出处:网络
We are trying to determine the best way to patch InputDevice.java to correct a sensor issue. The touchscreen is detecting the location

We are trying to determine the best way to patch InputDevice.java to correct a sensor issue. The touchscreen is detecting the location opposite of the pressure. For instance, to unlock the device, I have to put my finger in the exact spot on the left side of the screen for it to register on the right side. The same thing happens for buttons, press right to touch the left button, and vice versa. We thought it might be possible to half the absolute value, but that may not work as the absX range is 0-4095. From debug:

Left Side D/InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 3708.0 D/InputDevice( 1062): absX.minValue = 0 D/InputDevice( 1062): absX.range = 4095 D/InputDevice( 1062): w = 799 D/InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 3711.0 D/InputDevice( 1062): absX.minValue = 0 D/InputDevice( 1062): absX.range = 4095 D/InputDevice( 1062): w = 799

Right Side /InputDevice( 1062): reportData[j + MotionEvent.SAMPLE_X] = 256.0 D/InputDevice( 1062): absX.minValue = 0 D/InputDevice( 1开发者_如何学JAVA062): absX.range = 4095 D/InputDevice( 1062): w = 799

Would adjusting currentmove be the place? or is there a better way to correct this issue in Froyo?


if (absX != null) {

             reportData[j + MotionEvent.SAMPLE_X]=absX.range - reportData[j + MotionEvent.SAMPLE_X];





                reportData[j + MotionEvent.SAMPLE_X] =

                        ((reportData[j + MotionEvent.SAMPLE_X]-absX.minValue)   / absX.range) * w;

            }
0

精彩评论

暂无评论...
验证码 换一张
取 消