按键机制
用户点击-->硬件中断-->/dev/input/event*写入一个相应的信号-->android循环读取/dev/input/event*的事件-->分发给WindowManagerServer-->分发到相应的ViewGroup和View
事件分析
以手头的测试机为例
执行adb shell getevent,返回结果
add device 1: /dev/input/event14
name: "compass_sensor"
add device 2: /dev/input/event0
name: "max77803-muic"
add device 3: /dev/input/event1 //触摸屏
name: "sec_touchscreen"
add device 4: /dev/input/event11 //物理按键
name: "gpio-keys"
add device 5: /dev/input/event13
name: "Headset"
add device 6: /dev/input/event12 //触摸键
name: "sec_touchkey"
add device 7: /dev/input/event10
name: "ssp_context"
add device 8: /dev/input/event9
name: "gesture_sensor"
add device 9: /dev/input/event8
name: "temp_