开发学院手机开发Android 开发 在Android层实现触摸屏校验 阅读

在Android层实现触摸屏校验

 2010-05-31 14:35:00 来源:WEB开发网   
核心提示://once editstatic final String CALIBRATION_FILE = "/data/etc/pointercal";//edit endsfinal int id;final int classes;final String name;final AbsoluteInf

//once edit

static final String CALIBRATION_FILE = "/data/etc/pointercal";

//edit ends

final int id;

final int classes;

final String name;

final AbsoluteInfo absX;

final AbsoluteInfo absY;

final AbsoluteInfo absPressure;

final AbsoluteInfo absSize;

//once edit

static TransformInfo tInfo;

//edit ends

long mDownTime = 0;

int mMetaKeysState = 0;

static File desFile;

final MotionState mAbs = new MotionState(0, 0);

final MotionState mRel = new MotionState(TRACKBALL_MOVEMENT_THRESHOLD,

TRACKBALL_MOVEMENT_THRESHOLD);

static class MotionState {

int xPrecision;

int yPrecision;

float xMoveScale;

float yMoveScale;

MotionEvent currentMove = null;

boolean changed = false;

boolean down = false;

boolean lastDown = false;

long downTime = 0;

int x = 0;

int y = 0;

int pressure = 1;

int size = 0;

MotionState(int mx, int my) {

xPrecision = mx;

yPrecision = my;

xMoveScale = mx != 0 ? (1.0f/mx) : 1.0f;

yMoveScale = my != 0 ? (1.0f/my) : 1.0f;

}

MotionEvent generateMotion(InputDevice device, long curTime,

boolean isAbs, Display display, int orientation,

int metaState) {

if (!changed) {

return null;

}

//once edit

//String prop = System.getProperty("ts.config.calibrate", "noset");

String prop = SystemProperties.get("ts.config.calibrate", "noset");

if (prop.equalsIgnoreCase("start")){

Log.i("XXW prop", prop);

Log.i("XXW", "prop.equalsIgnoreCase start");

device.tInfo = null;

}else if (prop.equalsIgnoreCase("done")){

上一页  1 2 3 4 5 6 7  下一页

Tags:Android 实现 触摸屏

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接