先來說一說安卓鍵值的知識,沒耐心學(xué)的可以直接拉倒低看怎么修改: 第一步: init.rc:通過service remotecfg /system/bin/remotecfg /system/etc/remote.conf在開機(jī)init階段,將remote.conf中的配置通過ioctl賦值到ir驅(qū)動的變量中(用戶空間—>內(nèi)核空間),這樣遙控定制化配置才會生效。remotecfg程序代碼位于external/remoteconf/irremote.c,可以在設(shè)備的/system/bin/下找到它并手動運(yùn)行#./system/bin/remotecfg /system/etc/remote.conf 第二步: 紅外驅(qū)動(Linux內(nèi)核層):Linux irremote driver將依照紅外驅(qū)動配置文件,將紅外鍵值ircode映射為Linux標(biāo)準(zhǔn)鍵盤掃描碼scancode。這個(gè)過程即將紅外遙控器的按鍵事件轉(zhuǎn)換為Linux的標(biāo)準(zhǔn)input event。a) 紅外驅(qū)動配置文件/system/etc/remote.confb)標(biāo)準(zhǔn)鍵盤掃描碼kernel/include/linux/input.h(在幾次遙控器定制化中,尚未修改過該文件) 第三步: Andriod層:windows manager從irremote driver中讀出key event,再通過/system/usr/keylayout/aml_keypad.kl文件,將標(biāo)準(zhǔn)input設(shè)備的scan code映射為Andriod API按鍵KEYCODE字符串。最終scancode和keycode被window manager發(fā)送到應(yīng)用程序,被其focus view消化處理。例如:key 113 SEARCH官方稱.kl為key layout map file。
映射/配置文件說明 ircode映射為scan code: device/a***c/xxx/remote.conf #a***c NEC remote factory_code = 0xfb040001 //每個(gè)設(shè)備都有獨(dú)特的factory code. 格式custom_code(16bit)+index_code(16bit) //例子: 0xfb040001= 0xfb04(客戶碼) + 0001 (低16位可填寫任意值) key_begin //按鍵映射表 0x47 11 //0x47是紅外鍵值,11是對應(yīng)的標(biāo)準(zhǔn)按鍵scancode,可以多個(gè)鍵值對應(yīng)一個(gè)scancode 0x5C 97 …… key_end //按鍵映射表結(jié)束
mouse_begin //鼠標(biāo)方向映射表,每行 0 0x10 //0是方向數(shù)字表示符(Left),對應(yīng)紅外按鍵鍵值0x10 1 0x11 //方向鍵右 2 0x0b //方向鍵上 3 0x0e //方向鍵下 mouse_end //鼠標(biāo)方向映射表結(jié)束
scancode與KEYCODE字符串映射: 在2.3[color=rgb(68, 68, 68) !important]系統(tǒng)中,位于源碼目錄的device/a***c/xxx/ aml_keypad.kl 在4.0系統(tǒng)中,位于源碼目錄的device/a***c/xxx/Vendor_0001_Product_0001.kl
因?yàn)?a href="http://ktgpgw.cn/bbs-133-1.html" target="_blank" class="relatedlink">酷開系統(tǒng)全是4.0以上安卓,所以我們需要找到一下兩個(gè)文件: /system/usr/keylayout/Vendor_0001_Product_0001.kl
/system/etc/remote.conf
電視系統(tǒng)ROOT后,用RE找到上述兩個(gè)文件。用文件編輯器打開;
/remote.conf 文件中內(nèi)容:
- #*********************************************************************************************************
- #this file is configuration for each factory remote device
- # work_mode 0 :software mode 1 :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 disable 1 :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_leader time 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
- 0x1f 0x2e7
- 0x6a 0x1f2
- 0xf6 0x1b #da_fei_suo_start
- 0xc6 0x1a #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
[color=rgb(35, 147, 223) !important]復(fù)制代碼
Vendor_0001_Product_0001.kl 文件內(nèi)容:
- 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>
[color=rgb(35, 147, 223) !important]復(fù)制代碼
其中
key 26 NEW_SHUTTLE_LEFT
key 27 NEW_SHUTTLE_RIGHT
即是飛梭的鍵值。
為了實(shí)現(xiàn)全局飛梭,我們來修改一下:
key 26 DPAD_LEFT
key 27 DPAD_RIGHT
也就是把鍵值直接替換為左右。
保存后退出,電視斷電重啟,再試試。完美飛梭實(shí)現(xiàn)啦!不要太爽了。老系統(tǒng)請見
|