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

Support gamepad input #35

Open
27thLiz opened this issue Jan 28, 2016 · 5 comments
Open

Support gamepad input #35

27thLiz opened this issue Jan 28, 2016 · 5 comments

Comments

@27thLiz
Copy link
Contributor

27thLiz commented Jan 28, 2016

As the title says, I think (local-) multiplayer games like this are best played with gamepads in front of a tv ^^

I tried to do this by simply adding gamepad bindings to the project settings, but it seems they are overwritten by the config system which only supports keyboard input using scancodes.
So the changes would be a bit more intrusive...

@akien-mga
Copy link
Owner

Thanks for looking into this :)
Indeed my quick and dirty input config UI assumes keyboard input, I'll have to have a deeper look at how to handle joystick input and display it properly in-game (might need adding some additional bindings as was done for keyboard input scancodes).

Need to buy a new gamepad :D

@mischiefaaron
Copy link

Godot had gamepad support before 2.0 even if it needed a bit of work, so I think it's crucial we reimplement the support if it's now missing. I mean aside from my own self interests in developing gamepad oriented games. I haven't tried the 2.0 beta yet, so I'm unsure how it's changed.

akien: I recommend getting a Zhidong N, which allows for switching between Direct Input & X Input driver modes, great for testing this very scenario so you can get many controllers working just from testing the one controller.

It's also great if you something that works with damn near every game old or new :)

Only issue is it's binding is not like the 360, which the XInput drivers were obviously designed after so some games that don't have binding options just assume it must be the same buttons :/

@akien-mga
Copy link
Owner

Well Godot still has gamepad support, and enhanced a lot by @Hinsbart actually :)
I just mentioned not being sure if there is a way to retrieve the name of a joystick button/axis based on events, but I haven't looked into it yet.

@27thLiz
Copy link
Contributor Author

27thLiz commented Feb 3, 2016

Well, on windows and linux the gamepad situation changed quite a bit. OSX on the other hand still completely lacks joystick support.
We updated the joystick code to use both DirectInput and XInput (instead of an ancient media API) on windows, and evdev instead of js* on linux.
With this also came built-in gamepad remapping using SDL2 compatible mappings :)

See this database for a list of included mappings.

So seeing that this project needs godot 2.0 to run, I don't think it's a good idea to code for any case other than the default gamepad layout.

Also:
An XInput compatible controller that actually sends different events from the official one is just broken.
I also own two devices that are a complete failure at the hardware level. What are those vendors thinking when they release such a product...? not much, I guess :P

@27thLiz
Copy link
Contributor Author

27thLiz commented Feb 3, 2016

Getting the name of a button/axis is not possible currently, but might be a nice idea actually. thanks :)

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

No branches or pull requests

3 participants