遙控器按鍵索引值映射,遙控器按鍵映射

來源:互聯網
上載者:User

遙控器按鍵索引值映射,遙控器按鍵映射

在linux環境下輸入getevent命令
遙控器按一個鍵,出現的第二行,第二個數,就是這個鍵對應的16進位,
轉成10進位之後放入system\usr\keylayout\Vendor_2389_Product_00a8_Version_0200.kl檔案中,
然後讓這個鍵對應1,2,DPAD_UP,CHANNEL_UP等或自訂為F9(電視,需捕獲之後自己跳轉),F2(電影需捕獲之後自己跳轉)
如果是全域都可以用的按鈕,則還需要在在system\etc\hotkey.xml中進行跳轉


不同的遙控器要配合不同的.kl檔案

在linux環境下輸入getevent -v 命令

130|root@n302:/ # getevent -v
add device 4: /dev/input/event2       //kl檔案的命名規則Vendor_0c45_Product_1109_Version_0100.kl
bus: 0003
vendor 0c45
product 1109
version 0100
name: "coocaa Device coocaa Wireless Device"
location: "usb-lm2-1/input0"
id: ""
version: 1.0.1
add device 5: /dev/input/event0
bus: 0010
vendor 0001
product 0001
version 0100
name: "aml_keypad"
location: "keypad/input0"
id: ""
version: 1.0.1
add device 6: /dev/input/event1
bus: 0010
vendor 1b8e
product 0cec
version 0001
name: "cec_input"
location: ""
id: ""
version: 1.0.1

 

 

 

 

 

kl檔案

例子:system\usr\keylayout\Vendor_0c45_Product_1109_Version_0100.kl
key 11 0
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 139 MENU WAKE_DROPPED
key 158 BACK
key 108 DPAD_DOWN
key 103 DPAD_UP
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 28 DPAD_CENTER

key 104 CHANNEL_UP WAKE_DROPPED
key 109 CHANNEL_DOWN WAKE_DROPPED
key 172 HOME WAKE_DROPPED

key 14 DEL

key 59 F1
key 63 F2
key 64 F3
key 65 F4
key 67 F5
key 68 F6
key 87 F7
key 88 F8

key 183 F9
key 184 F10

 

 

例子:system\etc\hotkey.xml

<?xml version="1.0" encoding="utf-8"?>
<hotkey>
<event
code="00b7"
cmd="am start -n com.xxxxx.tvplay/com.xxxxx.tvplay.MainActivity"/>
</hotkey>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.