Gamepad API with Ionic

Hi!

I am relatively new to Ionic and need some help with my Ionic project.
My goal is to “listen” to PlayStation remote in my ionic app (using HTML 5 Gamepad API)
Unfortunately, there is no Cordova plugin or any examples of how this can be done with ionic.
But there is an angular library that I found, which can do it:

My problem is how to import / make this library work in Ionic 5 + Cordova.
Would be great if someone could point me into the right direction…

Thanks in advance!

Have you tried following the instructions on the NPM page?

If you are already using Angular as your JS framework than your Ionic project is basically a Angular project, meaning any instructions for an Angular project should work just fine.

Thank you for the info. I will give it a try now :slight_smile:

1 Like

Actually I found out this package was limited because it supported only buttons and not joysticks position. So I just use HTML5 gamepad API directly in Javascript inside ngOnInit()
Seems to work perfectly :slight_smile:

1 Like