By Vlad Stirbu.
This plugin allows you to use Android gamepads in Cordova/PhoneGap applications.
Using Cordova command line interface:
cordova plugins add https://github.com/vstirbu/GamepadButtons
The javascript API follows the W3C Gamepad API, extended with elements from Mozilla Gamepad API.
- navigator.getGamepads()
- window.gamepadconnected
- window.gamepadbutton
Currently, the plugin supports only the device's incorporated gamepad. External gamepads not supported.
The following events have not been implemented:
- gamepaddisconnected (not needed on the incorporated gamepad)
- gamepadaxismove (my development device does not have have analog joysticks)
The plugin was tested on the following devices:
The plugin is available under MIT license.