欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

android 驱动层检测TP按了几个手指数量

程序员文章站 2022-03-13 22:36:20
首先执行以下三条命令[]1 adb shell[2] su[3] getevent -rtl会打印类似以下信息设备节点信息:add device 1: /dev/input/event3 name: "focaltech_ts"add device 2: /dev/input/event2 name: "accelerometer"could not get driver version for /dev/input/mice, Not a typewrit......

首先执行以下三条命令

[]1 adb shell

[2] su

[3]  getevent -rtl

会打印类似以下信息设备节点信息:

add device 1: /dev/input/event3
  name:     "focaltech_ts"
add device 2: /dev/input/event2
  name:     "accelerometer"
could not get driver version for /dev/input/mice, Not a typewriter
add device 3: /dev/input/event0
  name:     "stk_als"
add device 4: /dev/input/event1
  name:     "proximity"
add device 5: /dev/input/event4
  name:     "sc27xx:vibrator"
add device 6: /dev/input/event7
  name:     "sprdphone Headset Keyboard"
add device 7: /dev/input/event5
  name:     "gpio-keys"
add device 8: /dev/input/event6
  name:     "sprdphone Headset Jack"

当你一个手指按到屏幕时会打印:

[  132300.819016] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   00000263            //打印一个ID 则代表一个手触屏
[  132300.819016] /dev/input/event3: EV_ABS       ABS_MT_POSITION_X    000000ca            
[  132300.819016] /dev/input/event3: EV_ABS       ABS_MT_POSITION_Y    000001b5            
[  132300.819016] /dev/input/event3: EV_KEY       BTN_TOUCH            DOWN                //动作状态down
[  132300.819016] /dev/input/event3: EV_SYN       SYN_REPORT           00000000             rate 0

抬起一个手指时打印:

[  132302.202497] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   ffffffff            
[  132302.202497] /dev/input/event3: EV_KEY       BTN_TOUCH            UP                         //抬起手指
[  132302.202497] /dev/input/event3: EV_SYN       SYN_REPORT           00000000             rate 0
 


当你两个手指按到屏幕时会打印:则会打印两组ABS_MT_TRACKING_ID,一组ABS_MT_TRACKING_ID代表一个手指触屏

[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   00000264            
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_POSITION_X    0000015b            
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_POSITION_Y    00000185            
[  132471.322353] /dev/input/event3: EV_KEY       BTN_TOUCH            DOWN                
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_SLOT          00000001            
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   00000265            
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_POSITION_X    000000b2            
[  132471.322353] /dev/input/event3: EV_ABS       ABS_MT_POSITION_Y    0000015c            
[  132471.322353] /dev/input/event3: EV_SYN       SYN_REPORT           00000000             rate 0

抬起两个手指时打印:也会报两组 ABS_MT_TRACKING_ID,

[  132473.346652] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   ffffffff            
[  132473.346652] /dev/input/event3: EV_SYN       SYN_REPORT           00000000             rate 0
[  132473.356032] /dev/input/event3: EV_ABS       ABS_MT_SLOT          00000000            
[  132473.356032] /dev/input/event3: EV_ABS       ABS_MT_TRACKING_ID   ffffffff            
[  132473.356032] /dev/input/event3: EV_KEY       BTN_TOUCH            UP                  
[  132473.356032] /dev/input/event3: EV_SYN       SYN_REPORT           00000000             rate 106
 

本文地址:https://blog.csdn.net/nei504293736/article/details/110224896