Joystick Input for Linux

I’m building a simple arcade style, 2d game with Unity which I plan to run on/distribute for Ubuntu.

I have two joysticks, they both work with MAME in Ubuntu and in the Unity WebGL in Ubuntu, but I can’t get any joystick input for the full Linux version (.x86 file) of the game.

So far, I’ve only found this post: No joystick detected which seems to address a similar issue, but I don’t see why all the extra work is necessary especially since both controllers are fine in with Ubuntu in MAME and Unity WebGL in Ubuntu with NO additional setup.

The Input Manager in Unity seems to be setup correctly, the game is so simple there’s only Left, Right and Jump. I’ve tried manually configuring both controllers under the Configuration window in the Input tab when the game is launched, but Unity doesn’t detect any input from the controllers and can’t be custom mapped.

Thanks!

Unity: 2017.2.of3
Ubuntu: 16.04
Controllers: Reyann Arcade USB Encoder and Logitech Dual Action

Quick Update:

Adding the generic usb joystick to the environment solved my problem, followed steps in this thread:

The game controller system is necessary because there’s no standard for joystick drivers on Linux that says “Left stick horizontal will report as this axis index, right trigger will report as that axis index, …”

In the era of Unity 4.x, we just passed through axis and button indices as reported by the device driver, and it was a mess. Game developers needed to know exactly what joystick was being used and had to special-case the input mappings for each device. With the advent of the SDL game controller system, recognized devices are presented automatically and consistently, and it’s possible for users to add support for their own devices when they’re not recognized.

If you’re interested, you could contribute the mappings for your devices to https://github.com/gabomdq/SDL_GameControllerDB