Fix PS4 DualShock 4 button mapping on the Fire TV

dualshock-4-keymap-header
The PlayStation 4 DualShock 4 controller is one of the best alternate game controllers that easily connects to the Amazon Fire TV right out of the box. The only problem with the controller is that the Fire TV sees it as the official Amazon Fire Game Controller which results in some buttons being mapped incorrectly. User lilcza1 on the XDA-Developer forums has created a custom android keylayout (.kl) file which correctly maps the DualShock 4 buttons. Read on for our guide on how to install the custom key layout file. 

In order to install the custom key layout file, your Fire TV must be rooted. Rooting your Fire TV is simple. Just follow our guide here.

  1. Download (right-click and select save as…) the custom keylayout file: Vendor_054c_Product_05c4.kl
  2. If your DualShock 4 has already been paired with your Fire TV, go to Settings > CONTROLLERS and unpair it.
  3. Connect to your Fire TV via ADB
  4. Run the command:
    adb push <full-path-to-file>\Vendor_054c_Product_05c4.kl /sdcard/
    (NOTE: Replace <full-path-to-file>  with the path to the file you download on your computer. For example: adb push C:\Downloads\Vendor_054c_Product_05c4.kl /sdcard/ )
  5. Run the following commands one by one:
    (NOTE: Each command is one line. There are 8 lines/commands total.)

    1. adb shell
    2. su
      (NOTE: If you have never run the command su before, your Fire TV will display a popup asking for you to grant permission. Select “Grant” on the popup)
    3. mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
    4. cp /sdcard/Vendor_054c_Product_05c4.kl /system/usr/keylayout/
    5. mount -o ro,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
    6. rm /sdcard/Vendor_054c_Product_05c4.kl
    7. exit
    8. exit
      (NOTE: Yes, you run exit twice)
  6. Restart the Fire TV by holding Select and Play simultaneously on the Fire TV remote for a few seconds.
  7. Pair your DualShock 4 gamepad with the Fire TV by holding the share and PS button down at the same time until you see the sensor light blinking rapidly.

Sourcelilcza1 on XDA-Developers

ShareTweetShare+1

30 comments
  1. Joseph says:

    Thanks for the PS4 Mapping. I played a couple SNES games – Just awesome. One problem though:

    With the NES emulators (tried a couple) I cannot get the P$4 controller to work them. The “Start” and “Select” buttons from the PS4 just do not work.

    Any ideas why? Thanks! I really can’t wait to play Super Mario Bros.

  2. AFTVnews says:

    What do you mean by “The Start and Select buttons from the PS4 just do not work” since the DualShock 4 does not have start and select buttons. The .kl file posted should set the DualShock 4’s “Options” button to function as “Start” and the “Share” button to function as “Select”. Are those two buttons not working for you?

  3. Lilcza1 says:

    Download the App “Gamepadtest” and check and see if your controller is mapped correctly. All the buttons should match when you push them on screen to what was mapped to my .kl file. It sounds like the .kl file didn’t get pushed to your box.

  4. Joseph says:

    @Lilcza1 -I see the file .kl file in the correct folder (using ES Explorer). I followed all instruction above and the SNES emulator SNES9XEX+ works perfectly.

    I figured out it is the NES emulator as I tried a couple and just couldn’t get any of them to work. I finally tried “a NES Free”. Not sure how many people are running emulators on the FireTV just yet but those are the two I have gotten working with no problems yet.

    Thanks for the fast replies!

  5. Dan says:

    having hard time paring and when I do pair wireless controller battery is offline. cant get it to work

  6. stefan says:

    Having same issues as Dan. Will not pair regardless of what I do. Tried plugging into cell phone charger, switched USB charging cables 3x, multiple reboots and unplugs. Even tried pairing two DS4s at once. No dice whatsoever. I am rooted but did not previously pair a DS4 before following the above guide, wonder if that is causing problems?

    • dan says:

      Try this, once you select wireless controller pair hit return key on fire TV remote it should be paired but battery is off. Can’t figure that part out. Works with controller plugged in USB. .KL file mapping is good.

    • Xodaru says:

      Hold the share and PS button at the same time down until you see the sensor light blinking rapidly. This will put the DS4 into pair mode and the Fire TV will happily recognise it.

      Might be a good idea if the guide is updated to include this step.

  7. Stacey says:

    I am having problems trying to get
    adb push Vendor_054c_Product_05c4.kl /sdcard/
    to work.

    I put a copy of Vendor_054c_Product_05c4.kl into C:\FTV and C:\adbfw108\adbfw108\Vendor_054c_Product_05c4.kl

    C:\FTV>dir \adbfw108\adbfw108\Vendor_054c_Product_05c4.kl
    Volume in drive C has no label.
    Volume Serial Number is 80C0-0424

    Directory of C:\adbfw108\adbfw108

    10/03/2014 07:28 PM 1,257 Vendor_054c_Product_05c4.kl
    1 File(s) 1,257 bytes
    0 Dir(s) 149,753,434,112 bytes free

    C:\FTV>dir c:\FTV\Vendor_054c_Product_05c4.kl
    Volume in drive C has no label.
    Volume Serial Number is 80C0-0424

    Directory of c:\FTV

    10/03/2014 07:28 PM 1,257 Vendor_054c_Product_05c4.kl
    1 File(s) 1,257 bytes
    0 Dir(s) 149,753,434,112 bytes free

    C:\FTV>

    C:\FTV>dir C:\adbfw108\adbfw108\Vendor_054c_Product_05c4.kl
    Volume in drive C has no label.
    Volume Serial Number is 80C0-0424

    Directory of C:\adbfw108\adbfw108

    10/03/2014 07:28 PM 1,257 Vendor_054c_Product_05c4.kl
    1 File(s) 1,257 bytes
    0 Dir(s) 149,753,155,584 bytes free

    C:\FTV>

    But when I start an ADB Shell from adbFire or “FTV Side APP installer”
    I get errors trying to find the file which should be local as I have it in those directories.

    adbFire says ADB running Device connected

    shell@android:/ $ adb push Vendor_054c_Product_05c4.kl /sdcard/
    adb push Vendor_054c_Product_05c4.kl /sdcard/
    cannot stat ‘Vendor_054c_Product_05c4.kl’: No such file or directory

    1|shell@android:/ $ adb push C:\adbfw108\adbfw108\Vendor_054c_Product_05c4.kl /sdcard/
    \Vendor_054c_Product_05c4.kl /sdcard/ <
    cannot stat 'C:adbfw108adbfw108Vendor_054c_Product_05c4.kl': No such file or directory

    1|shell@android:/ $ adb push C:\\adbfw108\\adbfw108\\Vendor_054c_Product_05c4.kl /sdcard/
    08\\Vendor_054c_Product_05c4.kl /sdcard/ <
    cannot stat 'C:\adbfw108\adbfw108\Vendor_054c_Product_05c4.kl': No such file or
    directory

    1|shell@android:/ $

    Those are 3 attempts, one with default path, one with full name but it loses the slashes and one with quoting the slash with an extra slash but those two have some extra display echoed out that looks wrong and also says No such file or directory.

    Why is this not working for me?
    What am I doing wrong?

    I have the same issue trying to push update.zip for a new release to /cache , I always get No such file, except one time very early on it worked once but was too slow and had to reboot laptop to get performance of the adb shell back. But then push never worked.

    Alternatively, Is there another way to get these files over that is reliable and will not dork with the file contents of type?

    Thanks for your help.

    • Stacey says:

      Well no one apparently had any ideas….

      I still have the issue and it is a pain in the butt. It will never push anything.

      I can get a shell and I can go SU and I can look at stuff from the shell on the Fire TV. I can copy “cp” files on the AFTV also. Just can not run push. I can also Install APK from adbfire. I do have issues with both ADBFIRE and FTV side app installer. On adbFire it will sometimes get slow and other times will not connect and I have to STOP ADB server START it ande Connect again or disconnect and connect again to get the ADB shell to launch and work properly. Sometimes it says something like Device disconnected or did not connect.

      But anyways I got around the issues of not geing able to PUSH to it by “Sideloading StickMount onto your Fire TV” which I saw another guide.

      With Stickmount I could read/see a SDcard/usb stick and I just copied the files where I needed them and continued with the installs.

      This worked both for getting the keylayout file in place and for moving the update.zip for the later kernel/OS/ROM update.

      The update to 51.1.1.0_user_511070220 worked fine. I had to redo Root, SU and the rest but it worked.

      The update of the keylayout seemed to work but I can not get it to Pair. I am still working on that.

      • AFTVnews says:

        You are running your push commands inside shell. That is wrong. You need to run your push commands in the commands prompt outside of shell.

        Your line:
        shell@android:/ $ adb push Vendor_054c_Product_05c4.kl /sdcard/

        Should look like:
        C:\FTV> adb push Vendor_054c_Product_05c4.kl /sdcard/

        • Stacey says:

          OK thanks that cleared up some stuff after I played with it a while:

          I did not know there was a ADB I could run directly from a CMD window on WINDOWS7.

          So I did the install as shown in http://www.aftvnews.com/how-to-sideload-apps-to-your-amazon-fire-tv-using-a-windows-pc/ Following Step 1. to Step 4 up to and including 4.2.

          But I had issues when Step 4.1 said to “1.Shift + Right-Click on an empty area of the “platform-tools” folder and select “Open command window here””

          I was not able to get it to ever say “Open command window here”. First I was not doing the SHIFT. THen when I tried the SHIFT and RIGHTCLICK it still did not work. No “Open command window here” displayed.

          So I copied a Command Prompt in that dir and then changed it’s properties to “Start In” the correct directory. Then I created a shortcut and stuck it on the desktop. That fixed it.

          Then I found that the Shift Rightclick does give you the option to Open a command window. You just have to do it exactly right. You have to be careful not to have anything Highlighted first or Shift Rightclick will not show that option!

          Windows!!!!!! just a bit to sensitive.

          Then I ran the adb push and it worked!

          Thanks for your help this will make things go more smoothly in the future.

  8. Stacey says:

    I finally got the file over and did the mount/cp/mount ….

    I reboot the FTV and go to the Bluetooth controllers and ADD.
    It scans and I hold the SHARE and PS button for 5 seconds and it does a double flash pauses and then another double flash and continues that for a while.

    On the FTV it changes to Wireless Controller and I select that and then it says Pairing but it never completes. I tried doing more SHIFT PS to keep the flashing going but it never pairs. It says Pairing Not Successful try pairing in settings again. Or something like that.

    Any ideas?

    This seems to be similar to what DAN had above. Mine never completes the pairing.

    • Stacey says:

      I also can see that if I click RETURN and Wireless controllers it shows “wireless controller battery is offline, >|| to Unpair.

      Is that what it is suppose to show when it is paired?

      I thought that maybe this means it got paired so I tried to run Asphalt 8: Airborne But it does not seem to do anything from the controller. It only seems to works with the AFTV remote.

      What is a free app that is known to work with the PS4 DS4 Bluetooth game controller?

      What should the settings say in the Bluetooth controller page in System Settings?

  9. Pauly says:

    Long time fan of this website! I pretty much visit this site daily to see anything new you are cooking up…. Great job and thank you for all of your effort!

    My question has to do with pairing a PS4 controller to the firetv – everything works except there is the HOME function doesn’t work on the PS4 controller. I believe it’s button 172 and it just doesn’t work.

    Can anyone else confirm that when you connect your PS4 controller to the fireTV by following instruction above (which I think i did), the PS button act as the FireTV HOME button?

    Just trying to narrow it down the issue…

  10. Pauly says:

    Ok I did some digging around, and I confirmed that I followed the instruction here to the teeth (I was able to reverse the X and O button by making a small change to the kl file above).

    So here’s what I believe is going on – and this is inline w/ a lot of the other ppl’s comments I’ve seen:

    The PS4 controller mapping works just fine in FireTV home browser mode, but when you enter specific apps, you mileage WILL vary.

    It would’ve been cool to be able to standardize the keys for all apps, although I am not sure if that’s possible.

  11. Jared says:

    Is there any way to get an Xbox One bluetooth controller to work on the Fire TV? I also have a wireless Xbox 360 one, and a Dualshock 3. I tried pairing the Xbox One and DS3 in the pairing mode but the Fire TV never saw them and I also tried connecting using the USB and still nothing. Is the DS4 the only game console controller that will work because if so I guess I’ll just buy one because they’re about the same price as a general Android controller that usually aren’t as good.

  12. Joe says:

    This file works for some games, but not for others. I was able to remap the gas-break for Airborn 8. However, some games will not recognize the PS4 controller. For example, I cannot use “Naught 2” because it does not recognize the D-pad or the ‘A’ button. Also, the game “Hero to Many” does not recognize the D-pad. I have repeated the instuctions and completed a factory reset… same issue.

    Perhaps you could provide the original/stock/updated “Vendor_054c_Product_05c4.kl” file in the software section. I would like to revert back.

  13. mrmikey05 says:

    Thank you so much. I purchased a new TV, Hisense 55h6sg 55 inch Android TV, and and PS4 controller. I can paired the controller but the mapping is all weird until I FTP the file provided to my /System/usr/keylayout folder. Now I’m enjoying my snes emulator on my tv with the ps4 controller. Thanks again.

  14. Joshua Puchalski says:

    My experiments are with using the hdx 8.9, but seem to have exactly the same behavior mimiced. I can pair the DS4 without any difficulty, i simply have the issue of an incorrect keymap. Not being able to root (currently at 4.5.2) is putting a heavy dampervon the parade however. I have NEVER been so close to being able to comfortably play GTA San Andreas portably, and Sooo smooth on this beautiful display. All drool aside, is there any way i can get that keymap in place without rooting? Is this adb work possiible without root? More than happy to do the work and reading myself if someone can point the way, i love to learn, but if its not possible, id hate to waste my time and get no fruit. Thanks!

  15. Chad says:

    I am using 51.1.4.1 (rooted). I am trying to pair my ps4 controller, but it is failing to pair. Do you have any idea as to why? I am successfully getting the controller to go into Discovery Mode, but will not pair with my Fire TV.

    • Darryl says:

      My UK Fire TV is rooted via hardware method. I’m on 51.1.4.0. It doesn’t pair either.

      The annoying this is, it’s the PS4 controller that doesn’t stay in pairing mode long enough that’s the problem. It needs another 10-15 seconds.

  16. Ken says:

    Can you connect multiple ps4 controllers?

  17. unscahted says:

    if it doesnt pair after blinking repeatedly… the use your AFTV remote, move up to wireless controller and try again. It usually works the second time.

  18. Brian says:

    How do you remove this? I believe it is messing up the mapping on my nyko controllers. They work fine on the sticks I have.

    • cdlenfert says:

      I was going to ask something along the same line. I have Gamestop Red Samurai controllers and was thinking it would be cool to us the ps4 controller at the same time, or switch around between the two brands. If this will mess with my other controllers, I’ll probably pass, but if it only has an effect on the official Fire TV controller (or the Nyko mentioned above) then I thin it’s worth a shot. Is there a step in this how to that makes a backup of the original Keymap?

  19. Tom says:

    Hey, when i try to use the mount comment i’m always getting this:

    255|root@sloane:/ # mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name>
    mount: Invalid argument
    255|root@sloane:/ #

    Using Adbfire on my mac. cant’t get it to work any ideas?

    • Adam says:

      Same issue here, I’m on rbox’s latest FireOS 5. Can the guide be updated for this newer version? Thanks!

  20. Mc says:

    I got the controller to pair but it has some serious lag when playing snes.

Leave a Reply

Your email address will not be published. Required fields are marked *

*