Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Game Controller Tester

Test any input device including gamepad, haptic, vibration, mouse, keyboard, touch screen, sensors · By POW Games

Question about HIDAPI

A topic by rdnxndr created Aug 26, 2024 Views: 98 Replies: 2
Viewing posts 1 to 2

The program works great, but in other testers and emulators the Pro Controller axes do not work correctly and some buttons are mixed up. Could you give me a hint on how to fix this Android problem? Your program requests access to the gamepad and thanks to this it works as it should, but other apps do not recognize the gamepad (access request popup). I replaced the keylayout file with an updated one, but it didn't change anything.

Developer (1 edit)

Hi, thanks for reaching out. 

An Android app should set up a list of permissions to access gamepads. One of the pop-ups when the app starts for the first time is a "BLUETOOTH_CONNECT" permission, which in theory is only needed for Steam controllers. I believe there's another one that pops up when you insert a gamepad in to USB, which is the important one. I've seen a discussion about this on Github regarding emulators not connecting to controllers because they're lacking this permission, which needs to be included in the Manifest when the app is built.

My app uses the same comprehensive gamepad mapping database used by the Steam client. This might be where my app has the advantage over others. Different Android versions will produce different scancodes for Nintendo Pro gamepads as well, which adds to this problem.

So in conclusion, the other apps need to have better gamepad support coded into them. It's a big task to get it working, which is where SDL & HIDAPI do the heavy lifting for me. 

Does disabling HIDAPI in my app make much difference? If you use my app to give the gamepad a kick-start before entering the other app, does that help (it's been known to with some gamepads) ? Keylaout file?  Is that the .kl file? I have considered adding support for kl files, but have zero experience with them. What puts me off is that the few mapping apps out there have terrible reviews because it opens a whole can of worms that end up disappointing users who don't know about rooting.  Your input is welcome.

Yes, when HIDAPI is disabled, there is no popup and the gamepad does not work correctly. The same thing happens when connected via Bluetooth. 

Unfortunately, launching it first does not help, since the input from the gamepad after granting access is “fixed” in your app. For example, the same thing happens when a player requests exclusive access to DAC and the audio output is fixed to this player. 

Yes, "updated" /system/usr/keylayout/Vendor_057e_Product_2009.kl Unfortunately, this trick had no effect.

I'm not a developer, but I thought that maybe I could, for example, edit the Manifest in Citra emulator and compile the apk back. But if mapping database and other things are required, then it will be easier to just buy another gamepad. 

Thanks for the answer