Android(安卓)input上报*、#键值笔记
16lz
2021-01-26
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.验证可行。
#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]AndroidInject增加sqlite3数据库映射注解(ORM)
- 充电clientandroid电池(五):电池 充电IC(PM2301)驱动分析篇
- android按键映射
- android 背光驱动
- Android(安卓)binder机制(native服务篇)
- android 平台USB wifi驱动移植及使用
- android应用程序的混淆打包(转)
- 7-framework--详解 8 Android平台开发-WIFI 驱动移植 -- 详细 9
- 解决 Android(安卓)N 上报错:android.os.FileUriExposedException