1

I need html / javascript that will capture the input of a Firestick controller and have it do something else. Specifically I need the "Play/Pause" on the controller aka "Next" on the soft keyboard to minimize the keyboard. Since there is no Key ID for the "Back" button, I would like to have the click of next make the selector go left once then press enter.

So far I have the below but this just reloads the page. When I hit next.

Please be aware javascript is new to me so if you assist, please know I know nothing (John Snow) :-)

<script>
function checkKey(e){
    if(e.keyCode == 179) {
        //Play-Pause Button
e.key = "37";
e.key = "13";
    }
}
  </script>

//Later in the form brackets

<form action="#" onkeydown="checkKey(event);" id="custom-data" _lpchecked="1">
onkeydown="checkKey(event);"

https://developer.amazon.com/docs/fire-tv/supporting-controllers-in-web-apps.html

cabotek
  • 11
  • 2
  • I've not tested this but it will likely work if you remove focus from the input field to close the keyboard, either by calling .blur() on the input, or by calling .focus() on a different (non-input) element. – anotheruser1488182 Aug 30 '22 at 15:02

0 Answers0