1. Execute getevent -l | grep MSC_SCAN in the serial port or adb shell, then press the corresponding button on the remote control to obtain the device ID and scancode.
The MSC_SCAN data is 32 bits.
Bits [31:24] represent the key press status, where 0 indicates release, and 1 indicates press.
Bits [23:8] represent the device ID. Use this ID to generate a keylayout file named customer_ir_xxxx.kl. For example, in this case, it would be customer_ir_fe01.kl.
Bits [7:0] represent the scancode.
2. Based on the results of step one, create a new file named customer_ir_xxxx.kl with the following content:
Map the scancodes in the second column to Android keycodes.
3.Use the adb command to push customer_ir_xxxx.kl to the system.
$ adb root
$ adb remount
$ adb push customer_ir_xxxx.kl /system/usr/keylayout/
$ adb reboot
For source code porting, put the customer_ir_xxxx.kl to vendor/w/common/hardware/input/multi_ir/keylayout/ directory and build the source code.
详细步骤:
1.可不用添加adb工具到path:
解压adb工具到英文目录:
开发板上电,并打开开发者模式中的USB调试,连接电脑
adb工具目录下打开powershell,执行命令
图示代表连接设备成功
输入命令退出
2.输入命令提取开发板中的文件,到adb所在的目录
3.解析遥控器中的按键值
执行命令,并按下遥控器中的键,记录键值,改写customer_ir_4040.kl,4040要改成遥控器对应的值
4.上传customer_ir_4040.kl