Android系统适配蓝牙遥控器键值

1,先确定走(/system/usr/keylayoutandroid系统中在/framework/base/data/keyboards)哪一个kl文件,可以通过指令getevent-l是那个event事件;cat/proc/bus/input/devices查看,根据Vendor,Product,Version确定kl,没有对应的kl文件,则走默认的Generic.kl;

 

root@Hi3798MV200:/system/usr/keylayout# cat /proc/bus/input/devices          

I: Bus=0000Vendor=0001 Product=0001 Version=0100

N:Name="Hi keyboard"

P: Phys=

S:Sysfs=/devices/virtual/input/input0

U: Uniq=

H:Handlers=sysrq rfkill kbd event0 cpufreq_interactive

B: PROP=0

B: EV=3

B:KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe

 

I: Bus=0000Vendor=0001 Product=0002 Version=0100

N:Name="Hi mouse"

P: Phys=

S:Sysfs=/devices/virtual/input/input1

U: Uniq=

H:Handlers=mouse0 event1 cpufreq_interactive

B: PROP=0

B: EV=7

B:KEY=1f0000 0 0 0 0 0 0 0 0

B: REL=103

 

I: Bus=0000Vendor=0000 Product=0000 Version=0100

N:Name="qwerty"

P: Phys=

S:Sysfs=/devices/virtual/input/input2

U: Uniq=

H:Handlers=mouse1 event2 cpufreq_interactive

B: PROP=0

B: EV=b

B: KEY=4000 0 0 0 0 0 0 0 0 0

B:ABS=2658000 11000003

 

I: Bus=0019Vendor=0001 Product=0001 Version=0001

N:Name="front_panel_input"

P: Phys=

S:Sysfs=/devices/virtual/input/input3

U: Uniq=

H:Handlers=sysrq rfkill kbd event3 cpufreq_interactive

B: PROP=0

B: EV=3

B:KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe


(2)通过getevent -l查找对应hid键值对应的字符串,例如:HOME;

键值0x4a = 74对应字符串KEY_HOME

hid有256个键值保存在device\hisilicon\bigfish\sdk\source\kernel\linux-3.18.y\drivers\hid\hid-input.c定义的数组中,如下图所示,可以看到hid_keyboard[74] = 102,而在linux_key.h(不是在此处定义的)中键值102对应的按键字符串为KEY_HOME;

 

 Android系统适配蓝牙遥控器键值_第1张图片

 

\device\hisilicon\bigfish\system\ir_user

\bootable\recovery\ir_user\key_pars


你可能感兴趣的:(android系统)