Add functionality to support keys outside of directional arrows and enter button.
The main use case for this functionality is the ability to map a key like the escape button the functionality of a home or back button on a TV remote.
is this working?
It works for me. When the focus is on the search bar, pressing the space key or esc key (called out in my commit) will console log a supported key was pressed.
because the feature code is not merged into dead/react-key-navigation repo npm install on the example writes the original repo files into node_modules. If you pull the code from my pull request build the react-key-navigation code and replace examples/youtube-react-tv/node_modules/react-key-navigation/build/ folder with react-key-navigation/build and run the example you will see the console log as stated above.
Steps to get the custom key example running clone master cd to react-key-navigation npm install npm run-script build
cd examples/youtube-react-tv/ npm install replace "examples/youtube-react-tv/node_modules/react-key-navigation/build/" folder with the one you just built "react-key-navigation/build" npm run start-dev
open browser to view example, when the focus is on the search bar at the top, press space or esc and you will see the console log, (spacebar press does same action as enter, esc only has a console log)