I am building a game using Linux version 5.1.0f3 of Unity that makes use of keyboard controls and an xbox controller. In a stand alone player for Linux the keys and the controller correspond to what has been mapped in the project settings. However, when I build a WebGL version of the player some weird stuff happens. I describe it below.
Some of the buttons work for the controller: x, y, a, b, left and right bumpers.
The left and right analogues are behaving as if they’re mapped to random axes and some are inverse. The right trigger buttons are calling the functions mapped to the start button.
What this suggests to me is the joystick axis numbers are different for WebGL, is this true?
Some of the buttons work for the keyboard: number buttons, arrow keys.
However the w, s, a, d axes are behaving like with the controller and the + and - keys aren’t working.
So, the keyboard inputs work with WebGL in the latest version. But not with an xbox controller. I have seen this reported as a bug and it is apparently fixed in 5.4. Looks like I just have to wait until 5.4 is released for Linux to see if it has been fixed.