android 下aml平台遥控器按键值key配置

1.查看键盘映射

getevent 获取event设备

root@android:/ # getevent                                                     

add device 1: /dev/input/event3
  name:     “Microsoft  Microsoft Basic Optical Mouse v2.0 “
could not get driver version for /dev/input/mouse1, Not a typewriter
add device 2: /dev/input/event2
  name:     “cec_input”
add device 3: /dev/input/event0
  name:     “ScalarPolicy”
could not get driver version for /dev/input/mice, Not a typewriter
add device 4: /dev/input/event1
  name:     “aml_keypad”
could not get driver version for /dev/input/mouse0, Not a typewriter
[ 8711.189102@0] fcode map = 0 press ircode = 0x0f, scancode = 0x006c
/dev/input/event1: 0001 006c 00000001
/dev/input/event1: 0000 0000 00000000
[ 8711.458565@0] fcode map = 0 release ircode = 0x0f, scancode = 0x006c
/dev/input/event1: 0001 006c 00000000
/dev/input/event1: 0000 0000 00000000
 
可以确定,使用的遥控输入设备是aml_keypad

dumpsys input

 

3: aml_keypad
      Classes: 0x0000002b
      Path: /dev/input/event1
      Descriptor: 485d69228e24f5e46da1598745890b214130dbc4
      Location: keypad/input0
      UniqueId:
      Identifier: bus=0x0010, vendor=0x0001, product=0x0001, version=0x0100
      KeyLayoutFile: /system/usr/keylayout/Vendor_0001_Product_0001.kl
      KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
      ConfigurationFile:
      HaveKeyboardLayoutOverlay: false
 

获得使用的kl,查看对应的键值,例如:

key 61    CALL
key 97    DPAD_CENTER
key 232   DPAD_CENTER
key 108   DPAD_DOWN
key 103   DPAD_UP
key 102   HOME
key 105   DPAD_LEFT
key 106   DPAD_RIGHT

2.遥控器配置

查看遥控器spec,获取按键码值

映射上述的kl文件。

修改device/amlogic/g30ref/remote.conf

1.factorycode

遥控器的客户码,比如说客户码为00BD

factorycode =0xbd000001

后面固定为0001,前面记得位置换一下。

2.常用按键

left_key_scancode  = 0x49                                                                                    
right_key_scancode = 0x4a                                                                                    
up_key_scancode    = 0x0b                                                                                    
down_key_scancode  = 0x0f  
ok_key_scancode    = 0x0d  

根据遥控器的码值修改

3.键值映射区

key_begin                                                                                                    
                0x01 116                                                                                     
                0x0f 113                              
                0x6a 60                               
                0x0b 103                                   
                0x0d 97                                    
                0x0f 108                                        
                0x49 105                                        
                0x4a 106                                        
                0x0a 139                                        
                0x55 102                                                                                     
                0x54 158                                                                                     
                0x0C 115                                                                                     
                0x10 114                                                                                     
                0x58 121   
                0x57 120   
                0x5e 102   
                0x5f 102   
key_end       
 
0x49 为遥控器码值,105为kl文件中left的key
     

 

 

 

 

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据