HTML5-JavaScript-Gamepad-Controller-Library icon indicating copy to clipboard operation
HTML5-JavaScript-Gamepad-Controller-Library copied to clipboard

Linux & xbox controller

Open daedeloth opened this issue 11 years ago • 3 comments

Hi,

Awesome project! Saves me a lot of time. I've got it working on windows, but the mapping in chrome / linux with my xbox 360 controller is wrong.

I've been looking at the code for a way to override the mapping for linux, but am I right in saying that currently there is no filter for platform? mac / windows / linux?

Many thanks, Thijs

daedeloth avatar Dec 22 '13 21:12 daedeloth

You are correct in that assumption, this library is OS agnostic in nature

On Sun, Dec 22, 2013 at 9:08 PM, daedeloth [email protected] wrote:

Hi,

Awesome project! Saves me a lot of time. I've got it working on windows, but the mapping in chrome / linux with my xbox 360 controller is wrong.

I've been looking at the code for a way to override the mapping for linux, but am I right in saying that currently there is no filter for platform? mac / windows / linux?

Many thanks, Thijs

— Reply to this email directly or view it on GitHubhttps://github.com/kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library/issues/17 .

JakeChampion avatar Dec 23 '13 01:12 JakeChampion

Currently the OS is not taken into account. But the code to determine the gamepad mapping could easily support it: Gamepad.prototype._resolveMapping() uses an env object which could have an additional os member for example (resolving the value would be a dedicated topic). A gamepad mapping could then also specify an os member, which acts as an additional filter matching only if its value is also found in that reference env.

But I so far have not found out whether the unification of button layouts for the same controller across OS and browsers must happen in JS-user land, in the browser or possibly in the OS.

dertseha avatar Dec 23 '13 14:12 dertseha

From what I understand, it is meant to be somewhat generalized. But any implementation of the gamepad api I've seen had my mapping mixed up.

I also don't think I have a way to fix it in ubuntu.

It's also hard to find people with similar issues, since not that many people have ubuntu & an xbox controller laying around.

I think I'll have a go at that added os member.

daedeloth avatar Dec 23 '13 20:12 daedeloth