Android多点触摸的实现——1.6patch 一 .docVIP

  • 2
  • 0
  • 约1.7万字
  • 约 10页
  • 2018-05-02 发布于河南
  • 举报
Android多点触摸的实现——1.6patch 一

Android多点触摸的实现——1.6patch(一) 第一章 摘要 在Linux内核支持的基础上,Android在其2.0源码中加入多点触摸功能。由此触摸屏在Android的frameworks被完全分为2种实现途径:单点触摸屏的单点方式,多点触摸屏的单点和多点方式。 第二章 软件位 在Linux的input.h中,多点触摸功能依赖于以下几个主要的软件位: ……………………….. #define SYN_REPORT 0 #define SYN_CONFIG 1 #define SYN_MT_REPORT 2 ………………………... #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ #define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ #define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ #define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ #define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ #define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */ #define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ ………………………… 在Android中对应的软件位定义在RawInputEvent.java中: ………………….. public class RawInputEvent { ………………. public static final int CLASS_TOUCHSCREEN_MT = 0 ……………….. public static final int ABS_MT_TOUCH_MAJOR = 0x30; public static final int ABS_MT_TOUCH_MINOR = 0x31; public static final int ABS_MT_WIDTH_MAJOR = 0x32; public static final int ABS_MT_WIDTH_MINOR = 0x33; public static final int ABS_MT_ORIENTATION = 0x34; public static final int ABS_MT_POSITION_X = 0x35; public static final int ABS_MT_POSITION_Y = 0x36; public static final int ABS_MT_TOOL_TYPE = 0x37; public static final int ABS_MT_BLOB_ID = 0x38; …………………. public static final int SYN_REPORT = 0; public static final int SYN_CONFIG = 1; public static final int SYN_MT_REPORT = 2; ……………….. 在Android中,多点触摸的实现方法在具体的代码实现中和单点是完全区分开的。在Android代码的EventHub.cpp中,单点屏和多点屏由如下代码段来判定: int EventHub::open_device(const char *deviceName) { ……………………… if (test_bit(ABS_MT_TOUCH_MAJOR, abs_bitmask) test_bit(ABS_MT_POSITION_X, abs_bitmask) test_bit(ABS_MT_POSITION_Y, abs_bitmask)) { device-classes |= CLASS_TOUCHSCREEN | CLASS_TOUCHSCREEN_MT; // LOGI(It is a mul

文档评论(0)

1亿VIP精品文档

相关文档