Android input上报*、#键值笔记

1.在./kernel-imx/include/linux/input.h增加scan code值
#define KEY_USR1    0x2f0
#define KEY_USR2    0x2f1


2.将驱动上报键值改成KEY_USR1、KEY_USR2,如TP上按键键值
此处省略

3.在编辑键值映射文件,存在device/fsl/sabresd_6dq目录下,文件名与input输入驱动名字相同,可以getevent查看
key 752   POUND
key 753   STAR

root@sabresd_6dq:/ # getevent
add device 1: /dev/input/event5
  name:     "goodix-ts"
could not get driver version for /dev/input/mice, Not a typewriter
add device 2: /dev/input/event4
  name:     "wm8962-audio Headphone Jack"
add device 3: /dev/input/event3
  name:     "wm8962-audio DMIC"
add device 4: /dev/input/event1
  name:     "power-wakup"
add device 5: /dev/input/event0
  name:     "gpio-keys"
add device 6: /dev/input/event2
  name:     "WM8962 Beep Generator"

4.让编译Android自动拷贝到/system/usr/keylayout目录
PRODUCT_COPY_FILES +=    \
    device/fsl/sabresd_6dq/gpio-keys.kl:/system/usr/keylayout/gpio-keys.kl

5.验证可行。

你可能感兴趣的:(Android)