此盒子支持atv,armbian,coreelec和libreelec,atv9.0支持多遙控器,armbian不需要遙控器,coreelec支持一款中興遙控器,增加其他遙控器比較簡(jiǎn)單,把安卓格式的遙控器編碼文件remote.conf拷貝到/storage/.config即可,libreelec不支持咱擁有的幾款遙控器,但增加也是比較容易的,通過一天研究分享方法如下:
1、了解內(nèi)核支持遙控器協(xié)議
先Ssh libreelec 執(zhí)行ir-keytable LibreELEC:~ # ir-keytable Found /sys/class/rc/rc0/ with: Name: meson-ir Driver: meson-ir Default keymap: rc-empty Input device: /dev/input/event0 LIRC device: /dev/lirc0 Attached BPF protocols: Supported kernel protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm Enabled kernel protocols: lirc nec rc-6 bus: 25, vendor/product: 0000:0000, version: 0x0000 Repeat delay: 500 ms, repeat period: 125 ms
2、記下遙控器按鍵編碼 執(zhí)行ir-keytable -t,對(duì)著盒子按遙控器,得到各個(gè)按鍵編碼(注意本遙控器是nec協(xié)議) LibreELEC:~ # ir-keytable -t Testing events. Please, press CTRL-C to abort. 2266.108068: lirc protocol(nec): scancode = 0x22ca 2266.160054: lirc protocol(nec): scancode = 0x22ca repeat 2269.112078: lirc protocol(nec): scancode = 0x22d2 2269.168055: lirc protocol(nec): scancode = 0x22d2 repeat 2270.804049: lirc protocol(nec): scancode = 0x2299 2270.860044: lirc protocol(nec): scancode = 0x2299 repeat 2272.952053: lirc protocol(nec): scancode = 0x22c1 2273.008031: lirc protocol(nec): scancode = 0x22c1 repeat 3、編輯編碼文件 在/storage/.config/rc_keymaps文件夾編輯my_remote編碼文件(注意第一行格式) # table my_remote,type:nec 0x22dc KEY_POWER 0x22ca KEY_UP 0x22d2 KEY_DOWN 0x2299 KEY_LEFT 0x22c1 KEY_RIGHT 0x22ce KEY_OK 0x2295 KEY_BACK 0x2282 KEY_MENU 0x2280 KEY_VOLUMEUP 0x2281 KEY_VOLUMEDOWN 0x229c KEY_MUTE 0x2288 KEY_HOME 4、加載編碼文件 執(zhí)行ir-keytable -c -w /storage/.config/rc_keymaps/my_remote LibreELEC:~ # ir-keytable -a /storage/.config/rc_maps.cfg Old keytable cleared Wrote 12 keycode(s) to driver Protocols changed to nec 看到上面輸出,此時(shí)遙控器可以控制kodi播放器了 在/storage/.config/文件夾編寫autostart.sh腳本可以開機(jī)自動(dòng)加載 5、可識(shí)別按鍵列表 Keycode KEY_LEFT KEY_STOPCD KEY_INFO KEY_TEXT KEY_RIGHT KEY_FASTFORWARD KEY_PROPS KEY_1 KEY_UP KEY_FORWARD KEY_ZOOM KEY_2 KEY_DOWN KEY_REWIND KEY_ANGLE KEY_3 KEY_OK KEY_VOLUMEUP KEY_MUTE KEY_4 KEY_ENTER KEY_VOLUMEDOWN KEY_POWER KEY_5 KEY_SELECT KEY_CHANNELUP KEY_SLEEP KEY_6 KEY_DELETE KEY_CHANNELDOWN KEY_WAKEUP KEY_7 KEY_ESC KEY_PAGEUP KEY_EJECTCD KEY_8 KEY_MEDIA KEY_PAGEDOWN KEY_9 KEY_HOME KEY_NEXT KEY_DVD KEY_0 KEY_EXIT KEY_NEXTSONG KEY_MENU KEY_NUMERIC_STAR KEY_BACK KEY_PREVIOUS KEY_VIDEO KEY_NUMERIC_POUND KEY_BACKSPACE KEY_PREVIOUSSONG KEY_AUDIO KEY_RED KEY_ESC KEY_EPG KEY_MP3 KEY_GREEN KEY_RECORD KEY_TITLE KEY_CAMERA KEY_BLUE KEY_PLAY KEY_TV2 KEY_IMAGES KEY_PLAYPAUSE KEY_CONTEXT_MENU KEY_TUNER KEY_RADIO KEY_PAUSE KEY_SUBTITLE KEY_TV KEY_STOP KEY_LANGUAGE KEY_PVR |