X Axis Sensor Correction - Flipped Sensor Detection - Froyo
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;
}
精彩评论