遥控器按键键值映射,遥控器按键映射


在linux环境下输入getevent命令
遥控器按一个键,出现的第二行,第二个数,就是这个键对应的16进制,
转成10进制之后放入system\usr\keylayout\Vendor_2389_Product_00a8_Version_0200.kl文件中,
然后让这个键对应1,2,DPAD_UP,CHANNEL_UP等或自定义为F9(电视,需捕获之后自己跳转),F2(电影需捕获之后自己跳转)
如果是全局都可以用的按钮,则还需要在在system\etc\hotkey.xml中进行跳转


不同的遥控器要配合不同的.kl文件

在linux环境下输入getevent -v 命令

130|root@n302:/ # getevent -v
add device 4: /dev/input/event2       //kl文件的命名规则Vendor_0c45_Product_1109_Version_0100.kl
bus: 0003
vendor 0c45
product 1109
version 0100
name: "coocaa Device coocaa Wireless Device"
location: "usb-lm2-1/input0"
id: ""
version: 1.0.1
add device 5: /dev/input/event0
bus: 0010
vendor 0001
product 0001
version 0100
name: "aml_keypad"
location: "keypad/input0"
id: ""
version: 1.0.1
add device 6: /dev/input/event1
bus: 0010
vendor 1b8e
product 0cec
version 0001
name: "cec_input"
location: ""
id: ""
version: 1.0.1

 

 

 

 

 

kl文件

例子:system\usr\keylayout\Vendor_0c45_Product_1109_Version_0100.kl
key 11 0
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
#key 139 MENU WAKE_DROPPED
key 158 BACK
key 108 DPAD_DOWN
key 103 DPAD_UP
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 28 DPAD_CENTER

key 104 CHANNEL_UP WAKE_DROPPED
key 109 CHANNEL_DOWN WAKE_DROPPED
key 172 HOME WAKE_DROPPED

key 14 DEL

key 59 F1
key 63 F2
key 64 F3
key 65 F4
key 67 F5
key 68 F6
key 87 F7
key 88 F8

key 183 F9
key 184 F10

 

 

例子:system\etc\hotkey.xml

<?xml version="1.0" encoding="utf-8"?>
<hotkey>
<event
code="00b7"
cmd="am start -n com.xxxxx.tvplay/com.xxxxx.tvplay.MainActivity"/>
</hotkey>

相关内容

    暂无相关文章