Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mappings for Xbox 360 Controller #3458

Closed

Conversation

@GreenLightning
Copy link
Contributor

GreenLightning commented Oct 4, 2015

This adds mappings for the Xbox 360 controller. See #2185 for my previous attempt.

Tested on Windows, OS X and Linux.

The GWT emulation is based on the Ouya emulation and the uses the Standard Gamepad Layout. However, I could not test the GWT emulation, because libgdx does not recognize my controller in the browser (it shows up fine here).

I also refactored the controller test so that it does not spam you with axis updates, but instead only shows the last value.

@intrigus
intrigus reviewed Oct 4, 2015
View changes
tests/gdx-tests/src/com/badlogic/gdx/tests/extensions/ControllersTest.java Outdated
@@ -1,184 +1,283 @@
/*******************************************************************************

This comment has been minimized.

Copy link
@intrigus

intrigus Oct 4, 2015

Contributor

Could you please fix this?
I don't understand what you added/removed

This comment has been minimized.

Copy link
@xoppa

xoppa Oct 4, 2015

Member

@intrigus Add ?w=1 to the url (someone at github should make that the default).

This comment has been minimized.

Copy link
@MobiDevelop

MobiDevelop Oct 4, 2015

Member

People should rather have their git/ide settings correct. It isn't just a diff hindrance... it makes it harder to track down when specific lines are changed (via git blame).

This comment has been minimized.

Copy link
@GreenLightning

GreenLightning Oct 4, 2015

Author Contributor

Sorry, didn't notice this. How can I configure git to do the right thing (via command line or eclipse)?

This comment has been minimized.

Copy link
@davebaol

davebaol Oct 4, 2015

Member

@GreenLightning
I've spent countless hours trying to fix this, really. Unfortunately nothing worked in my case.
So, if you find out a working solution, please, let me know.

This comment has been minimized.

Copy link
@GreenLightning

GreenLightning Oct 4, 2015

Author Contributor

@davebaol The problem was that I committed CR-LF line endings, although I don't know how that happened as core.autocrlf is set to true (I just checked it). I fixed the line endings and now it should work.

This comment has been minimized.

Copy link
@davebaol

davebaol Oct 4, 2015

Member

@GreenLightning
That's the problem. The core.autocrlf doesn't work for me (and you)

@GreenLightning GreenLightning force-pushed the GreenLightning:controller-mappings branch to a5d7878 Oct 4, 2015
@MobiDevelop
Copy link
Member

MobiDevelop commented Oct 9, 2015

I don't have an Xbox 360 controller to know whether this is correct or not... I do think it would be nice if the controller mapping could provide a way to normalize the values that are different between operating systems so that each developer didn't have to code for that.

@nooone
Copy link
Contributor

nooone commented Oct 9, 2015

There are some tools which can map the controller settings on the OS level to another controller I've used "MotioninJoy" or "DS Tool" to map my PS3 controller to an Xbox controller. Not really related to this PR, but maybe it helps with testing.

@GreenLightning
Copy link
Contributor Author

GreenLightning commented Oct 9, 2015

@MobiDevelop I have some ideas for a system to poll normalized values.

@GreenLightning GreenLightning force-pushed the GreenLightning:controller-mappings branch to 87c6893 Oct 9, 2015
@GreenLightning
Copy link
Contributor Author

GreenLightning commented Oct 9, 2015

What do you think?

@nhydock
Copy link

nhydock commented Oct 13, 2015

SDL2 has a game controller mapping DB that's community maintained. Could we maybe add parsing support for the same mapping format into LibGDX? Doing such could actually be mutually beneficial as we could gain the support of all the controllers, and the LibGDX community surely has people with game controllers who could contribute back profiles for the DB.

.

@badlogic
Copy link
Member

badlogic commented Jan 5, 2016

I'm currently adding Xbox360 mappings to libGDX myself in a more light-weight manner. I'll merge this manually with your changes. Thanks!

@badlogic badlogic closed this Jan 5, 2016
@badlogic
Copy link
Member

badlogic commented Jan 5, 2016

@nhydock great find @sdl controller mapping DB. A quick look at it tells me that this might not map to the values returned by OIS/GLFW, at least on Mac OS X. Maybe i can massage them somehow.

@GreenLightning
Copy link
Contributor Author

GreenLightning commented Jan 5, 2016

If you want me to test the mappings I have Windows and OS X and I can run Linux in a VM...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.