小妞给爷笑笑 发表于 2015-3-10 22:29

遥控器键值修改实现新系统全局飞梭

先来说一说安卓键值的知识,没耐心学的可以直接拉倒低看怎么修改:第一步:init.rc:通过service remotecfg /system/bin/remotecfg /system/etc/remote.conf在开机init阶段,将remote.conf中的配置通过ioctl赋值到ir驱动的变量中(用户空间—>内核空间),这样遥控定制化配置才会生效。remotecfg程序代码位于external/remoteconf/irremote.c,可以在设备的/system/bin/下找到它并手动运行#./system/bin/remotecfg /system/etc/remote.conf第二步:红外驱动(Linux内核层):Linux irremote driver将依照红外驱动配置文件,将红外键值ircode映射为Linux标准键盘扫描码scancode。这个过程即将红外遥控器的按键事件转换为Linux的标准input event。a) 红外驱动配置文件/system/etc/remote.confb)标准键盘扫描码kernel/include/linux/input.h(在几次遥控器定制化中,尚未修改过该文件)第三步:Andriod层:windows manager从irremote driver中读出key event,再通过/system/usr/keylayout/aml_keypad.kl文件,将标准input设备的scan code映射为Andriod API按键KEYCODE字符串。最终scancode和keycode被window manager发送到应用程序,被其focus view消化处理。例如:key 113 SEARCH官方称.kl为key layout map file。
映射/配置文件说明ircode映射为scan code: device/a***c/xxx/remote.conf#a***c NEC remotefactory_code = 0xfb040001 //每个设备都有独特的factory code. 格式custom_code(16bit)+index_code(16bit) //例子: 0xfb040001= 0xfb04(客户码) + 0001 (低16位可填写任意值)key_begin //按键映射表 0x47 11 //0x47是红外键值,11是对应的标准按键scancode,可以多个键值对应一个scancode0x5C 97……key_end //按键映射表结束
mouse_begin //鼠标方向映射表,每行0 0x10 //0是方向数字表示符(Left),对应红外按键键值0x101 0x11 //方向键右2 0x0b //方向键上3 0x0e //方向键下mouse_end //鼠标方向映射表结束
scancode与KEYCODE字符串映射:在2.3系统中,位于源码目录的device/a***c/xxx/ aml_keypad.kl在4.0系统中,位于源码目录的device/a***c/xxx/Vendor_0001_Product_0001.kl
因为酷开系统全是4.0以上安卓,所以我们需要找到一下两个文件:/system/usr/keylayout/Vendor_0001_Product_0001.kl
/system/etc/remote.conf
电视系统ROOT后,用RE找到上述两个文件。用文件编辑器打开;
/remote.conf 文件中内容:

[*]#*********************************************************************************************************
[*]#this file is configuration for each factory remote device
[*]#         work_mode          0 :software mode1 :hardware mode
[*]#      repeat_enable          0 :disable repeat 1 :enable repeat
[*]#
[*]#      factory_code      each device has it's unique factory code.
[*]#                        pattern:custom_code(16bit)+index_code(16bit)
[*]#                        examble: 0xff000001 = 0xff00(custom cod)0001 (index)
[*]#
[*]#      release_delay          unit:ms.release will report from kernel to user layer after this period of time
[*]#                        from press or repeat triggered.
[*]#
[*]#      debug_enable      0 :debug disable1 :debug disable
[*]#
[*]# SW MODE:
[*]#      bit_count          how many bits in each frame
[*]#      tw_leader_act          time window for leader active
[*]#      tw_bit0                  time window for bit0 time.
[*]#      tw_bit1                  time window for bit1 time
[*]#      tw_repeat_leadertime window for repeat leader1
[*]# REG
[*]#      reg_base_gen          set value for PREG_IR_DEC_BASE_GEN
[*]#      reg_control          set value for PREG_IR_DEC_CONTROL
[*]#      reg_leader_act          set value for PREG_IR_DEC_LEADER_ACTIVE
[*]#      reg_leader_idle          set value for PREG_IR_DEC_LEADER_IDLE
[*]#      reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
[*]#      reg_bit0_time          set value for PREG_IR_DEC_BIT0_TIME
[*]#*************************************************************************************************************
[*]#amlogic shuttleflying remote
[*]#skyworth remote
[*]
[*]factory_code   = 0x70700001
[*]work_mode      = 98
[*]repeat_enable   = 1
[*]debug_enable   = 1
[*]repeat_delay    = 800
[*]repeat_peroid   = 150
[*]
[*]key_begin
[*]      0x0c 0x74                #key_start
[*]                              0x01 0x2
[*]                              0x02 0x3
[*]                              0x03 0x4
[*]                              0x04 0x5
[*]                              0x05 0x6
[*]                              0x06 0x7
[*]                              0x07 0x8
[*]                              0x08 0x9
[*]                              0x09 0xa
[*]                              0x00 0xb
[*]                              0x1d 0x1d0
[*]                              0x19 0x1e4 #biao_shang_you
[*]                              0x0b 0x1d1
[*]                              0x12 0x1f5
[*]                              0x13 0x1f3
[*]                              0x14 0x73
[*]                              0x15 0x72
[*]                              0x0d 0x71
[*]                              0x0f 0x1d2
[*]                              0x46 0x1c
[*]                              0x9b 0x1d3
[*]
[*]                              0x42 0x67
[*]                              0x43 0x6c
[*]                              0x44 0x69
[*]                              0x45 0x6a
[*]                              0x5b 0x9e
[*]                              0x11 0x8b
[*]                              0x78 0x66
[*]                              0x79 0x1d4
[*]                              0x60 0x16d
[*]                              0x62 0x18e
[*]                              0x63 0x18f
[*]                              0x64 0x190
[*]                              0x65 0x191
[*]                              0x17 0x1d5
[*]                              0x18 0x1d6
[*]                              0x4f 0x1d7
[*]                              0x16 0x166
[*]                              0x47 0xa5
[*]                              0x48 0xa3
[*]                              0x40 0xa8
[*]                              0x41 0xd0
[*]                              0x49 0xa4
[*]                              0x4a 0xa6
[*]                              0x56 0x1d9
[*]                              0x5d 0x1da
[*]                              0x55 0x1db
[*]                              0x5c 0x16c
[*]                              0x57 0x1dc
[*]                              0x58 0x1dd
[*]                              0x54 0x1de
[*]                              0x4b 0xa7
[*]                              0x5a 0x1df
[*]                              0x5e 0x1e0
[*]                              0x5f 0x1e1
[*]                              0x59 0x1e2
[*]                              0x0a 0x1e3
[*]
[*]                              0xc1 0x2d4#xiao_fei_suo_start
[*]                              0xc2 0x2d5
[*]                              0xc3 0x2d6
[*]                              0xc4 0x2d7
[*]                              0xc5 0x2d8
[*]                              0xf1 0x2da
[*]                              0xf2 0x2db
[*]                              0xf3 0x2dc
[*]                              0xf4 0x2dd
[*]                              0xf5 0x2de#xiao_fei_suo_end
[*]                              0x69 0x2e0
[*]                              0x96 0x2e1                #biao_shang_butong
[*]                              0x9a 0x2e2               #biao_shang_butong
[*]                              0x66 0x2e3
[*]                              0x53 0x2e4
[*]                              0x50 0x2e5
[*]                              0x1b 0x2e6
[*]                              0x1f0x2e7
[*]                              0x6a 0x1f2
[*]                              0xf60x1b         #da_fei_suo_start
[*]                              0xc60x1a      #da_fei_suo_end
[*]                              0x6b 0x1f1
[*]                              0x4d 0x1f3
[*]                              0x9c 0x1f4
[*]                              0x75 0x1f5
[*]                              0x76 0x1f6   #key_end
[*]                              0x6c 0x1f7         #tv_box
[*]                              0x25 0x1f8
[*]
[*]                              0x3f 0x200   #factory_remote_start
[*]                              0x3e 0x201
[*]                              0x3d 0x202
[*]                              0x3c 0x203
[*]                              0x3b 0x204
[*]                              0x3a 0x205
[*]                              0x39 0x206
[*]                              0x38 0x207
[*]                              0x37 0x208
[*]                              0x36 0x209
[*]                              0x35 0x20a
[*]                              0x34 0x20b
[*]                              0x33 0x2c0
[*]                              0x32 0x2c1
[*]                              0x31 0x2c2
[*]                              0x30 0x2c3
[*]                              0x2f 0x2c4
[*]                              0x2e 0x2c5
[*]                              0x2d 0x2c6
[*]                              0x2c 0x2c7
[*]                              0x2b 0x2c8
[*]                              0x2a 0x2c9
[*]                              0x29 0x2ca
[*]                              0x28 0x2cb
[*]                              0x24 0x2cc
[*]                              0x23 0x2cd
[*]                              0x22 0x2ce
[*]                              0x21 0x2cf
[*]                              0x20 0x2d0      #factory_remote_end
[*]
[*]key_end
[*]
[*]repeat_key_begin
[*]          0x12 0x192
[*]          0x13 0x193
[*]          0x14 0x73
[*]          0x15 0x72
[*]          0x42 0x67
[*]          0x43 0x6c
[*]          0x44 0x69
[*]          0x45 0x6a
[*]          0x1f 0x2e7
[*]repeat_key_end
[*]

复制代码
Vendor_0001_Product_0001.kl 文件内容:

[*]key 116      POWER
[*]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 11       0
[*]key 464      DEL
[*]key 465      ALTERNATE
[*]key 402      CHANNEL_UP
[*]key 403      CHANNEL_DOWN
[*]key 115      VOLUME_UP
[*]key 114      VOLUME_DOWN
[*]key 113      VOLUME_MUTE
[*]key 466      TV_INPUT
[*]key 28       DPAD_CENTER
[*]key 467      VOICE
[*]key 737      VOICE_END
[*]key 103      DPAD_UP
[*]key 108      DPAD_DOWN
[*]key 105      DPAD_LEFT
[*]key 106      DPAD_RIGHT
[*]key 158      BACK
[*]key 139      MENU
[*]key 102      SETTING
[*]key 468      SHARE
[*]key 365      ENTER_EPG
[*]key 398      PROG_RED
[*]key 399      PROG_GREEN
[*]key 400      PROG_YELLOW
[*]key 401      PROG_BLUE
[*]key 469      IMAGE_MODE
[*]key 470      SOUND_MODE
[*]key 471      DISPLAY_MODE
[*]key 358      INFO
[*]key 165      MEDIA_PREVIOUS
[*]key 163      MEDIA_NEXT
[*]key 168      MEDIA_REWIND
[*]key 208      MEDIA_FAST_FORWARD
[*]key 164      MEDIA_PLAY_PAUSE
[*]key 166      MEDIA_STOP
[*]key 473      MEDIA_SONG_SYSTEM
[*]key 474      MEDIA_RELATIONSHIP
[*]key 475      MEDIA_BOOKING
[*]key 364      MEDIA_FAVORITES
[*]key 476      MEDIA_AUDIO_CONTROL
[*]key 477      MEDIA_FUNCTION
[*]key 478      MEDIA_ORIGINAL_SOUNDTRACK
[*]key 167      MEDIA_RECORD
[*]key 479      MEDIA_SELECTED_SONGS
[*]key 480      MEDIA_PRIORITY
[*]key 481      MEDIA_DELETE
[*]key 482      MEDIA_SCORE_DISPLAY
[*]key 483      NUM
[*]key 512      FACTORY_FACTORY_MODE
[*]key 513      FACTORY_RESET
[*]key 514      FACTORY_SOURCE_ADD
[*]key 515      FACTORY_SOURCE_REDUCE
[*]key 516      FACTORY_OUTSET
[*]key 517      FACTORY_BUS_OFF
[*]key 518      FACTORY_AGING_MODE
[*]key 519      FACTORY_AUTO_ADC
[*]key 520      FACTORY_AV1
[*]key 521      FACTORY_RF_AGC
[*]key 522      FACTORY_AV2
[*]key 523      FACTORY_AV3
[*]key 704      FACTORY_S1
[*]key 705      FACTORY_YUV1
[*]key 706      FACTORY_YUV2
[*]key 707      FACTORY_VGA
[*]key 708      FACTORY_HDMI1
[*]key 709      FACTORY_HDMI2
[*]key 710      FACTORY_HDMI3
[*]key 711      FACTORY_KALA_OK
[*]key 712      FACTORY_UPLAYER
[*]key 713      FACTORY_LAN
[*]key 714      FACTORY_DREAM_PANEL
[*]key 715      FACTORY_WHITE_BALANCE
[*]key 716      FACTORY_ALONE_LISTEN
[*]key 717      FACTORY_CA_CARD
[*]key 718      FACTORY_BARCODE
[*]key 719      FACTORY_SEARCH_UP
[*]key 720      FACTORY_SEARCH_DOWN
[*]key 183      SENSE_ALL
[*]key 184      SENSE_MENU
[*]key 185      SENSE_CENTER
[*]key 186      SENSE_BACK
[*]key 187      SENSE_VOLUME_UP
[*]key 188      SENSE_VOLUME_DOWN
[*]key 189      SENSE_CHANNEL_UP
[*]key 190      SENSE_CHANNEL_DOWN
[*]key 191      SENSE_LEAVE
[*]key 721      CHILD_LOCK
[*]key 741      HOME_LONG
[*]key 742      BACK_LONG
[*]key 743      MENU_LONG
[*]key 498      CENTER_LONG
[*]key 499      LOCAL_MEDIA
[*]key 500      RESEARCH
[*]key 501      SETTING
[*]key 502      MYSTEP
[*]key 503             TV_INPUT
[*]key 504             FACTORY_BLUETOOTH
[*]key 736      TIME_SPOT
[*]<font color="#ff0000">key 26       NEW_SHUTTLE_LEFT
[*]key 27       NEW_SHUTTLE_RIGHT</font>
[*]

复制代码

**** Hidden Message *****

保存后退出,电视断电重启,再试试。完美飞梭实现啦!不要太爽了。老系统请见

ebcg 发表于 2015-3-10 23:43

强烈支持楼主ing……

xgyfk01 发表于 2015-3-30 09:09

11111111

52zndsw 发表于 2015-5-13 22:17

我只是路过打酱油的。

Dispolly 发表于 2015-6-3 14:29

很给力,ZNDS有你更精彩!

bbnndd 发表于 2015-6-14 20:07

很给力,ZNDS有你更精彩!

第三联盟 发表于 2015-6-15 17:23

废话羊肉汤锅

第三联盟 发表于 2015-6-15 17:23

废话羊肉汤锅

fuwenlin 发表于 2015-6-15 18:37

嘿嘿,不知有木有用,试试先!!...

a夏宜 发表于 2015-9-2 20:42

!gjhg
页: [1] 2 3 4 5 6 7
查看完整版本: 遥控器键值修改实现新系统全局飞梭