• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Anyway to configure CEC remote commands from TV?

Search This thread

godsakes

Member
Jan 8, 2011
9
0
Hi

I love my firestick, it does so much more than what my previous raspberry pi (running kodi) could do. However one thing the pi could do was offer perfect CEC control via my TV's remote and one goal I have is to use a single (harmony) remote to control my entire AV setup.

The firestick does offer some level of CEC support but seems to vary hugely between different TVs, in my case on my Panasonic plasma tx-p42g30 I can only get the play/pause button to work (edit: the rewind, fast forward and stop buttons also work). So something is working but maybe not mapped properly?

Surely there must be somekind of file which can be edited to help map the CEC controls correctly? can anyone shed any light?
 
Last edited:

I_did_it_just_tmrrow

Senior Member
Feb 27, 2011
349
61
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.

Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.

Greetings by Idijt
 

godsakes

Member
Jan 8, 2011
9
0
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.

Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.

Greetings by Idijt

Whatever you think might get the ball rolling, it's one of those things before rooting was more accessible I'd assumed it'd be locked out feature to mod, but presumably with root it's a possibility now? I recall on the raspberry Pi i copied over a certain config file to enable additional buttons on my TV remote so hoping the same can be done.

I'm from the UK
 

I_did_it_just_tmrrow

Senior Member
Feb 27, 2011
349
61
My Panasonic XXX is currently not here.

Can you try to:
1. enable adb
2. open adb on a pc and type in
Code:
adb shell
or
Code:
adb shell
3. enable Panasonic's CEC and make sure you can use the less commands wich are usable
4a. type in shell
Code:
su
if you had root
4b. type in the shell
Code:
cat /proc/bus/input/devices
and tell us the output
5. There should be a line wich a named input, like input8 or input3.
6. type in the shell
Code:
cat THE_WHOLE_PATH_TO_THAT_INPUT_FILE
and tell us if he react if press on valid (working) buttons and non working buttons.

If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.

Greetings by Idijt
 

godsakes

Member
Jan 8, 2011
9
0
I had problems with a Panasonic TX-L37GN13 too.
CEC is called Viera-Cast on Panasonic TV's.

Perhaps we should create an topic in the developer board from amazon.
Where are you from? The US support should be much better then EU support.

Greetings by Idijt

My Panasonic XXX is currently not here.

Can you try to:
1. enable adb
2. open adb on a pc and type in
Code:
adb shell
or
Code:
adb shell
3. enable Panasonic's CEC and make sure you can use the less commands wich are usable
4a. type in shell
Code:
su
if you had root
4b. type in the shell
Code:
cat /proc/bus/input/devices
and tell us the output
5. There should be a line wich a named input, like input8 or input3.
6. type in the shell
Code:
cat THE_WHOLE_PATH_TO_THAT_INPUT_FILE
and tell us if he react if press on valid (working) buttons and non working buttons.

If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.

Greetings by Idijt

I've tried the commands via ADBfire and opening the adb shell - on 'su' I get a not found error (I don't have root)

On the 'cat /proc/bus/input/devices' command I get the following:

s3xlIIL.gif
 

I_did_it_just_tmrrow

Senior Member
Feb 27, 2011
349
61
I've tried the commands via ADBfire and opening the adb shell - on 'su' I get a not found error (I don't have root)

On the 'cat /proc/bus/input/devices' command I get the following:

http%3A%2F%2Fi.imgur.com%2Fs3xlIIL.gif
Why did you stop at Step 5? :D

Like I told you, do step 6,
Code:
cat /devices/virtual/input/input1
and tell us if he react if you press on valid (working) buttons and/or non working buttons.

If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
I can not check this before weekend.
Perhaps you dont have the right to "cat" the input1 without su/without root, but I think you should.

Greetings by Idijt
 

godsakes

Member
Jan 8, 2011
9
0
Why did you stop at Step 5? :D

Like I told you, do step 6,
Code:
cat /devices/virtual/input/input1
and tell us if he react if you press on valid (working) buttons and/or non working buttons.

If there are some hieroglyphics with the non working buttons, we should be able to mention theese buttons in the right keyfiles.
I can not check this before weekend.
Perhaps you dont have the right to "cat" the input1 without su/without root, but I think you should.

Greetings by Idijt
I'm afraid I get "no such file or directory" with that command...

Point me to the safest rooting guide and I'll give it a another try once rooted
 
Last edited:

I_did_it_just_tmrrow

Senior Member
Feb 27, 2011
349
61
I'm afraid I get "no such file or directory" with that command...
Perhaps you need to mount the system partition to rw (read, write) and it is currently ro (read only).

To change this mount you need root but you should be able to read thethe read the input.
Please make again the first cat step and be sure, that you cat in the next step the right input + path from the amazon-cec device.
Perhaps the inputs are connected to devices on device startup.
Point me to the safest rooting guide and I'll give it a another try once rooted
Point youself to the, perhaps availible, right rooting method or guide. Sorry but this is your device, you know your current stock FW and this is not the thread topic.
I own a stick with root, but hardware rooted with emmc adapter. If you life in germany or a neighbour country I can help you.

I hope we can leave this topic by its own topic :D
It really could be possible to add some keys from the tv remote.

Greetings by Idijt
 

godsakes

Member
Jan 8, 2011
9
0
Ok, I've since used king root to root the stick

Now when i type 'SU' the command line does indicate the user (if that's the right word?) is root

But I still get the same error... could you just double check I've done the right commands

g9syh5o.gif
 
Last edited:

I_did_it_just_tmrrow

Senior Member
Feb 27, 2011
349
61
Your commands seems to be right. I am not the 100% Linux pro but I am 80% sure that I do that on this way with a Xiaomi Bluetooth Controller.

Can list the area's?
Code:
su
ls /devices/
ls /devices/virtual/
ls /devices/virtual/input/
Each line after the other.
If that not work, tell us. You can check this too with another Input and device. Did you got always that error?

ByTheWay: you can just Copy the Text out of the shell/adb and put them here into a Code Block. This also very nice for people who are searching for some words.

Any other here who can help us?

Greetings by Idijt
 

godsakes

Member
Jan 8, 2011
9
0
Your commands seems to be right. I am not the 100% Linux pro but I am 80% sure that I do that on this way with a Xiaomi Bluetooth Controller.

Can list the area's?
Code:
su
ls /devices/
ls /devices/virtual/
ls /devices/virtual/input/
Each line after the other.
If that not work, tell us. You can check this too with another Input and device. Did you got always that error?

ByTheWay: you can just Copy the Text out of the shell/adb and put them here into a Code Block. This also very nice for people who are searching for some words.

Any other here who can help us?

Greetings by Idijt

same error with all 3 of those commands, I've tried a couple of variations of the previous step but again same error

Code:
[email protected]:/ $ su
su
[email protected]:/ # ls /devices/
ls /devices/
/devices/: No such file or directory
1|[email protected]:/ # ls /devices/virtual/
ls /devices/virtual/
/devices/virtual/: No such file or directory
1|[email protected]:/ # ls /devices/virtual/input/
ls /devices/virtual/input/
/devices/virtual/input/: No such file or directory
1|[email protected]:/ # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0005 Vendor=0000 Product=0000 Version=0008
N: Name="amazon_touch"
P: Phys=
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=2650000 1000000

I: Bus=0003 Vendor=0000 Product=0000 Version=0001
N: Name="amazon-cec"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=3ff 0 0 400000 2fc000 c3060 0 0 0 10004 210000 192 40000c01 9e3781 0 8010
0000 10000002

I: Bus=0005 Vendor=0000 Product=0000 Version=0008
N: Name="kcmouse"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=mouse0 event2
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

[email protected]:/ # cat /devices/virtual/input/input2
cat /devices/virtual/input/input2
tmp-mksh: cat: /devices/virtual/input/input2: No such file or directory
1|[email protected]:/ # cat devices/virtual/input/input1
cat devices/virtual/input/input1
tmp-mksh: cat: devices/virtual/input/input1: No such file or directory
1|[email protected]:/ # cat //devices/virtual/input/input1
cat //devices/virtual/input/input1
tmp-mksh: cat: //devices/virtual/input/input1: No such file or directory
1|[email protected]:/ #
 

nicefile

Member
Jan 20, 2008
22
1
All u have here is
[email protected]:/ # ls -la /sys/devices/virtual/input/input1/
drwxr-xr-x root root 2016-06-23 22:39 capabilities
drwxr-xr-x root root 2016-06-23 22:39 event1
drwxr-xr-x root root 2016-06-23 22:39 id
-r--r--r-- root root 4096 2016-06-23 22:39 modalias
-r--r--r-- root root 4096 2016-06-23 22:39 name
-r--r--r-- root root 4096 2016-06-23 22:39 phys
drwxr-xr-x root root 2016-06-23 22:39 power
-r--r--r-- root root 4096 2016-06-23 22:39 properties
lrwxrwxrwx root root 2016-06-23 22:39 subsystem -> ../../../../class/input
-rw-r--r-- root root 4096 2016-06-23 22:39 uevent
-r--r--r-- root root 4096 2016-06-23 22:39 uniq


BTW.
I've also got hard times with CEC with my sammy 40c650 . Only FF and REW are recogized by AFTS .
There is clear visibility on triggered events but no visibility on direct input (lack of tool)
[email protected]:/ # getevent -li /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
add device 1: /dev/input/event1
bus: 0003
vendor 0000
product 0000
version 0001
name: "amazon-cec"
location: ""
id: ""
version: 1.0.1
events:
KEY (0001): KEY_ESC KEY_ENTER KEY_DOT KEY_F5
KEY_KPENTER KEY_UP KEY_PAGEUP KEY_LEFT
KEY_RIGHT KEY_DOWN KEY_PAGEDOWN KEY_MUTE
KEY_VOLUMEDOWN KEY_VOLUMEUP KEY_POWER KEY_PAUSE
KEY_STOP KEY_HELP KEY_MENU KEY_BACK
KEY_EJECTCD KEY_PLAYPAUSE KEY_RECORD KEY_REWIND
KEY_FASTFORWARD KEY_SOUND KEY_MEDIA KEY_UNKNOWN
KEY_OPTION* KEY_INFO KEY_FAVORITES KEY_EPG
KEY_SUBTITLE KEY_ANGLE KEY_RED KEY_GREEN
KEY_YELLOW KEY_BLUE KEY_CHANNELUP KEY_CHANNELDOWN
KEY_LAST KEY_CONTEXT_MENU KEY_NUMERIC_0 KEY_NUMERIC_1
KEY_NUMERIC_2 KEY_NUMERIC_3 KEY_NUMERIC_4 KEY_NUMERIC_5
KEY_NUMERIC_6 KEY_NUMERIC_7 KEY_NUMERIC_8 KEY_NUMERIC_9
input props:
<none>
Output on button pressing (only FF and REW give out anything)
[email protected]:/ # getevent -l /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
EV_KEY KEY_REWIND DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_REWIND UP
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD DOWN
EV_SYN SYN_REPORT 00000000
EV_KEY KEY_FASTFORWARD UP
EV_SYN SYN_REPORT 00000000
 
Jun 27, 2016
27
23
The correct input device for cec on your FireStick is: /dev/input/event1.

If you want to change the behavior of your remote keys you can create a file named amazon-cec.kl under: /system/usr/keylayout.
However, don't know how this is on the FireTV and FireTV2. On the FireTV2 i don't get any responses using getevent and evtest and i dont own a FireTv Gen 1.

Edit:
Haven't seen the last post. Try using evtest on /dev/input/event1. It shows you the keycodes so you can assign them in the layout file.

for my old tv it would look like this:
Code:
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Custom Keylayout for Sony Bravia KDL-*EX72* cec function on FireStick

# NOTE
# This mainly mapps menu to the options button and home to the home button, 
# additionaly we assign keys to the special buttons (red, blue, info etc.).
# To make our life easier we just assign F1-F7 to those keys.
# Comments contain original values as per evtest /dev/input/event1

# NOTE: F1-F7 seem to not get passed to Kodi!? As Workaround we use A-F

key 96      DPAD_CENTER            #KPEnter (Real Enter)
key 103     DPAD_UP                      #Up
key 105     DPAD_LEFT                  #Left
key 106     DPAD_RIGHT               #Right
key 108     DPAD_DOWN               #Down

key 128     MEDIA_STOP                               #Stop
key 139     HOME        WAKE_DROPPED    #Menu 
key 158     BACK        WAKE_DROPPED     #Back
key 164     MEDIA_PLAY_PAUSE                #PlayPause
key 168     MEDIA_REWIND                        #Rewind
key 208     MEDIA_FAST_FORWARD         #Fast Forward

key 357     MENU                #Option
key 358     F                         #Info - KEY_INFO
key 365     E                         #EPG - KEY_EPG
#key 370     SUBTITLE         #Subtitle - KEY_SUBTITLE
key 398     A                         #Red Button - KEY_RED
key 399     B                         #Green Button - KEY_GREEN
key 400     C                         #Yellow Button - KEY_YELLOW
key 401     D                         #Blue Button - KEY_BLUE
key 402     PAGE_UP           #Channel Up
key 403     PAGE_DOWN    #Channel Down

key 512     0                #Numeric 0
key 513     1                #Numeric 1
key 514     2                #Numeric 2
key 515     3                #Numeric 3
key 516     4                #Numeric 4
key 517     5                #Numeric 5
key 518     6                #Numeric 6
key 519     7                #Numeric 7
key 520     8                #Numeric 8
key 521     9                #Numeric 9
 
Last edited:
  • Like
Reactions: Kramar111

godsakes

Member
Jan 8, 2011
9
0
Reading the above 2 posts and using the command 'getevent -1 /dev/input/event1'

I can get some reporting - but only for the buttons already recognised (play, rewind, fastforward, stop), I also have a play/pause button on my remote but it's recognised as the same command as the play button

Code:
[email protected]:/ $ su
su
[email protected]:/ # getevent -l /dev/input/event1
getevent -l /dev/input/event1
Can't enable monotonic clock reporting: Invalid argument
EV_KEY       KEY_PLAYPAUSE        DOWN
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_PLAYPAUSE        UP
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_REWIND           DOWN
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_REWIND           UP
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_STOP             DOWN
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_STOP             UP
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_FASTFORWARD      DOWN
EV_SYN       SYN_REPORT           00000000
EV_KEY       KEY_FASTFORWARD      UP
EV_SYN       SYN_REPORT           00000000
 
Last edited:
Jun 27, 2016
27
23
Try using evtest and look if the keycodes are indentical or not and remap them how you like.
I dont recommend using getevent for other use than getting the correct input device. If you press some button it only shows some kind of default value for the keyevent reported from your input device.

If you use evtest on /dev/input/event1 you can see what i mean by looking at the top of the output.
 

Attachments

  • evtest_Android5+.zip
    6.6 KB · Views: 44
Last edited:

nicefile

Member
Jan 20, 2008
22
1
@WheelchairArtist done & done
[email protected]:/ # evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x0 product 0x0 version 0x1
Input device name: "amazon-cec"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 1 (Esc)
Event code 28 (Enter)
Event code 52 (Dot)
Event code 63 (F5)
Event code 96 (KPEnter)
Event code 103 (Up)
Event code 104 (PageUp)
Event code 105 (Left)
Event code 106 (Right)
Event code 108 (Down)
Event code 109 (PageDown)
Event code 113 (Mute)
Event code 114 (VolumeDown)
Event code 115 (VolumeUp)
Event code 116 (Power)
Event code 119 (Pause)
Event code 128 (Stop)
Event code 138 (Help)
Event code 139 (Menu)
Event code 158 (Back)
Event code 161 (EjectCD)
Event code 164 (PlayPause)
Event code 167 (Record)
Event code 168 (Rewind)
Event code 208 (Fast Forward)
Event code 213 (Sound)
Event code 226 (Media)
Event code 240 (Unknown)
Event code 357 (Option)
Event code 358 (Info)
Event code 364 (Favorites)
Event code 365 (EPG)
Event code 370 (Subtitle)
Event code 371 (Angle)
Event code 398 (Red)
Event code 399 (Green)
Event code 400 (Yellow)
Event code 401 (Blue)
Event code 402 (ChannelUp)
Event code 403 (ChannelDown)
Event code 405 (Last)
Event code 438 (?)
Event code 512 (?)
Event code 513 (?)
Event code 514 (?)
Event code 515 (?)
Event code 516 (?)
Event code 517 (?)
Event code 518 (?)
Event code 519 (?)
Event code 520 (?)
Event code 521 (?)
Testing ... (interrupt to exit)
Event: time 452.538264, type 1 (Key), code 139 (Menu), value 0
Event: time 452.538274, -------------- Report Sync ------------
Event: time 462.140498, type 1 (Key), code 139 (Menu), value 1
Event: time 462.140507, -------------- Report Sync ------------
Event: time 478.609635, type 1 (Key), code 357 (Option), value 0
Event: time 478.609643, -------------- Report Sync ------------
Event: time 490.073024, type 1 (Key), code 357 (Option), value 1
Event: time 490.073032, -------------- Report Sync ------------
Event: time 503.634929, type 1 (Key), code 357 (Option), value 0
Event: time 503.634937, -------------- Report Sync ------------
Event: time 513.041136, type 1 (Key), code 168 (Rewind), value 1
Event: time 513.041146, -------------- Report Sync ------------
Event: time 513.260947, type 1 (Key), code 168 (Rewind), value 0
Event: time 513.260955, -------------- Report Sync ------------
Event: time 514.352655, type 1 (Key), code 208 (Fast Forward), value 1
Event: time 514.352663, -------------- Report Sync ------------
Event: time 514.576434, type 1 (Key), code 208 (Fast Forward), value 0
Event: time 514.576442, -------------- Report Sync ------------

there is no amazon-cec.kl under /system/usr/keylayout/ (also tested all in https://source.android.com/devices/input/key-layout-files.html) . I've downloaded Sony Bravia amazon-cec ,rebooted and nothing changed . Also creating Vendor_0000_Product_0000_Version_0001.kl keylayout (same as detected device ) give nothing ... no new button recognized ever .
 
Jun 27, 2016
27
23
Did u gave the amazon-cec file the right permissions and set the right owner? Also make sure to not forget the .kl at the end.

Also in my file the buttons u pressed (as seen in your post) are mapped the exact same way.
You could try to switch keycodes 139 and 208 to see if the layout file works.
 
Jun 27, 2016
27
23
Just for the record, today i updated my amazon-cec.kl file because it didn't work with my new stick on android 5, maybe that was your problem with my file?
If you still need/want to remap the buttons here is the new file (removed depracted WAKE_DROPPED flag and remapped Subtitle to G):

Code:
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Custom Keylayout for Sony Bravia KDL-*EX72* cec function on FireStick

# NOTE
# This mainly mapps menu to the options button and home to the home button, 
# additionaly we assign keys to the special buttons (red, blue, info etc.).
# To make our life easier we just assign F1-F8 to those keys.
# Comments contain original values as per evtest /dev/input/event1

# NOTE: F1-F8 seem to not get passed to Kodi!? As Workaround we use A-G

key 96      DPAD_CENTER            #KPEnter (Real Enter)
key 103     DPAD_UP                #Up
key 105     DPAD_LEFT            #Left
key 106     DPAD_RIGHT            #Right
key 108     DPAD_DOWN            #Down

key 128        MEDIA_STOP            #Stop
key 139        HOME                #Menu 
key 158     BACK                #Back
key 164        MEDIA_PLAY_PAUSE         #PlayPause
key 208     MEDIA_REWIND            #Rewind
key 168     MEDIA_FAST_FORWARD        #Fast Forward

key 357     MENU                #Option
key 358        F                 #Info - KEY_INFO
key 365        E                 #EPG - KEY_EPG
key 370        G                #Subtitle - KEY_SUBTITLE
key 398        A                #Red Button - KEY_RED
key 399     B                #Green Button - KEY_GREEN
key 400     C                #Yellow Button - KEY_YELLOW
key 401        D                #Blue Button - KEY_BLUE
key 402     PAGE_UP                #Channel Up
key 403     PAGE_DOWN            #Channel Down

key 512        0                 #Numeric 0
key 513     1                #Numeric 1
key 514     2                #Numeric 2
key 515     3                #Numeric 3
key 516     4                #Numeric 4
key 517     5                #Numeric 5
key 518     6                #Numeric 6
key 519     7                #Numeric 7
key 520     8                #Numeric 8
key 521        9                #Numeric 9
I switched the Rewind and FastForward buttons so you can check if it gets accepted.
You could also check logcat for any hints:

Code:
logcat | grep amazon-cec
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    The correct input device for cec on your FireStick is: /dev/input/event1.

    If you want to change the behavior of your remote keys you can create a file named amazon-cec.kl under: /system/usr/keylayout.
    However, don't know how this is on the FireTV and FireTV2. On the FireTV2 i don't get any responses using getevent and evtest and i dont own a FireTv Gen 1.

    Edit:
    Haven't seen the last post. Try using evtest on /dev/input/event1. It shows you the keycodes so you can assign them in the layout file.

    for my old tv it would look like this:
    Code:
    # Copyright (C) 2010 The Android Open Source Project
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    # Custom Keylayout for Sony Bravia KDL-*EX72* cec function on FireStick
    
    # NOTE
    # This mainly mapps menu to the options button and home to the home button, 
    # additionaly we assign keys to the special buttons (red, blue, info etc.).
    # To make our life easier we just assign F1-F7 to those keys.
    # Comments contain original values as per evtest /dev/input/event1
    
    # NOTE: F1-F7 seem to not get passed to Kodi!? As Workaround we use A-F
    
    key 96      DPAD_CENTER            #KPEnter (Real Enter)
    key 103     DPAD_UP                      #Up
    key 105     DPAD_LEFT                  #Left
    key 106     DPAD_RIGHT               #Right
    key 108     DPAD_DOWN               #Down
    
    key 128     MEDIA_STOP                               #Stop
    key 139     HOME        WAKE_DROPPED    #Menu 
    key 158     BACK        WAKE_DROPPED     #Back
    key 164     MEDIA_PLAY_PAUSE                #PlayPause
    key 168     MEDIA_REWIND                        #Rewind
    key 208     MEDIA_FAST_FORWARD         #Fast Forward
    
    key 357     MENU                #Option
    key 358     F                         #Info - KEY_INFO
    key 365     E                         #EPG - KEY_EPG
    #key 370     SUBTITLE         #Subtitle - KEY_SUBTITLE
    key 398     A                         #Red Button - KEY_RED
    key 399     B                         #Green Button - KEY_GREEN
    key 400     C                         #Yellow Button - KEY_YELLOW
    key 401     D                         #Blue Button - KEY_BLUE
    key 402     PAGE_UP           #Channel Up
    key 403     PAGE_DOWN    #Channel Down
    
    key 512     0                #Numeric 0
    key 513     1                #Numeric 1
    key 514     2                #Numeric 2
    key 515     3                #Numeric 3
    key 516     4                #Numeric 4
    key 517     5                #Numeric 5
    key 518     6                #Numeric 6
    key 519     7                #Numeric 7
    key 520     8                #Numeric 8
    key 521     9                #Numeric 9