在Android层实现触摸屏校验
2010-05-31 14:35:00 来源:WEB开发网xPrecision, yPrecision, device.id, edgeFlags);
} else {
if (currentMove != null) {
if (false) Log.i("InputDevice", "Adding batch x=" + scaledX
+ " y=" + scaledY + " to " + currentMove);
currentMove.addBatch(curTime, scaledX, scaledY,
scaledPressure, scaledSize, metaState);
if (WindowManagerPolicy.WATCH_POINTER) {
Log.i("KeyInputQueue", "Updating: " + currentMove);
}
return null;
}
MotionEvent me = MotionEvent.obtain(downTime, curTime,
MotionEvent.ACTION_MOVE, scaledX, scaledY,
scaledPressure, scaledSize, metaState,
xPrecision, yPrecision, device.id, edgeFlags);
currentMove = me;
return me;
}
}
}
static class AbsoluteInfo {
int minValue;
int maxValue;
int range;
int flat;
int fuzz;
};
//once edit
static class TransformInfo {
float x1;
float y1;
float z1;
float x2;
float y2;
float z2;
float s;
};
//edit ends
InputDevice(int _id, int _classes, String _name,
AbsoluteInfo _absX, AbsoluteInfo _absY,
AbsoluteInfo _absPressure, AbsoluteInfo _absSize) {
id = _id;
classes = _classes;
name = _name;
absX = _absX;
absY = _absY;
absPressure = _absPressure;
absSize = _absSize;
//once edit
desFile = new File(CALIBRATION_FILE);
readCalibrate();
//edit ends
}
static void readCalibrate(){
//xxw added
Log.i("XXW","readCalibrate!");
TransformInfo t = null;
try {
FileInputStream is = new FileInputStream(CALIBRATION_FILE);
更多精彩
赞助商链接