I’m new to Defold and I’m trying to get controller input to work on my computer, and I can’t get it to work. The only controller I have is a switch pro controller, and I’m wondering if the case is that Defold doesn’t natively support it?
There are bindings for the Switch Pro for the Nintendo Switch platform:
There are no bindings for this controller on any other platform. It would be great if you could contribute with the binding here. Step one is to check if Defold can identify the Switch Pro on your OS. Start by adding an input binding for the Connected event:
- Input bindings for gamepads: Gamepad input in Defold
- The Connected event: Gamepad input in Defold
If your computer identifies the Switch Pro the next step is to generate the bindings. We have a tool callled GDC that you can use:
Run the tool, follow the instructions and add the output to your .gamepads file. Please also share the result here so that we can add it to Defold for all users.
Since this pops up as the first result when searching for this, see this for more info: Big thread of gamepad testing - #53 by Wistpotion
Hey everyone
I’m having trouble getting both the Nintendo Switch Pro Controller and Xbox Elite Controller to work in Defold on macOS (currently on macOS 15.3.1).
Both controllers connect and function perfectly in macOS system-wide — I’ve verified they work in games and also using tools like https://joypad.ai/, where inputs are detected accurately. It’s coming up as “P2” on joypad.ai so not sure if that could be an issue? However, Defold doesn’t seem to recognize any inputs from either controller. Even when I run the gdc tool, it doesn’t detect button presses or joystick movement. Manually mapping I can get continuously automatic (without any input by me) pressed and released input but could be due to configure not being correct?
I’ve tried with the latest Defold version, a fresh project using and also disconnected all other peripherals just in case there was a conflict. Still no luck.
Has anyone else had similar issues with these controllers on macOS? Any workarounds or tips for getting Defold to recognize gamepad input? Would really appreciate any insight
Thanks in advance!
Can you give this a whirl?
Thanks @Alex_8BitSkull - I got it to work with the game mapper. The issue I have still is that Defold only starts to receive inputs if I first use the gamepad in another game/app. It’s really strange and really not sure why it could be like that. And also if it is isolated to my setup?
Would be interesting to know if anyone else had the issue needing to “invoke” the gamepad to get it to work in Defold.
For example I’m using this gamepad monitor which invokes it to register input in Defold:
No, this is not something I have experienced myself.
I suggest you raise an issue here, providing as much detail as possible!