Mapping Gamepad, adding not conventional gamepads to Defold

strange… i have osx too… but see no new files as you can see on my screenshot above.
anyway, thank you very much for giving me name of file generated by gdc “default.gamepads” - i’ll try to find it :slight_smile:

Odd, here’s what it looks like for me:

wow, thank you :slight_smile: strange, but I don’t have any… my be because you have only Bye at the end and I some strokes about trunkating history files. I’ll try to find out my local problem

Would this work with a amazon fire tv remote too?

I’m not familiar with Amazon Fire TV remote, but I don’t think it would register as a traditional gamepad. Do you have any link with information how it works that you could share?

I found this, is it correct? https://play.google.com/store/apps/details?id=com.amazon.storm.lightning.client.aosp&hl=en

It might be possible for us to catch some events that we currently aren’t listening to on Android.

edit: Ok, found some more detailed information here: https://developer.amazon.com/docs/fire-tv/remote-input.html

It looks like something we could/should listen to on Android devices. I’ll add an issue for it, but I can’t promise when it will be prioritised.

edit2: Issue added: DEF-3123

3 Likes

I’m trying to map a PlayStation 2 controller to use with Defold using the gdc mini-tool but get the same error as some others:

image

Windows recognises the gamepad and various testing programs I tried also function as expected. I’m considering getting a more modern controller but suspect I might get the same issue.

Any ideas?

1 Like

Hmm, I’m not very familiar with our gdc tool. @sven or @jhonny.goransson might know more?

1 Like

@benjames171
Could you try the Joystick Tester app I linked in this reply: Mapping Gamepad, adding not conventional gamepads to Defold

Does it show up?

Yes, I already tried that - it works as expected.

Damn, alright. :confused:
I need to find a PS2 controller and debug here, I don’t really have any other idea what could go wrong. Are you using a PS2->USB adapter btw?

Yes I’m using a PS2->USB adapter. Have also tried different USB ports and another computer but get the same error.

Trying to map a NES controller clone connected via USB. It has a four-way controller on the left, four action buttons on the right, a left and right shoulder button, as well as start and select keys. Mapping via the GDC mini-tool on MacOS works fine. However, these bindings result in the character moving continuously upwards and to the left when no keys are pressed. Changing the dead zone settings to 1, 10, 100, 1000 don’t seem to have an effect. Any thoughts?

gdc output below:

driver
{
device: "USB Gamepad "
platform: “osx”
dead_zone: 0.200
map { input: GAMEPAD_LPAD_LEFT type: GAMEPAD_TYPE_AXIS index: 3 mod { mod: GAMEPAD_MODIFIER_NEGATE } mod { mod: GAMEPAD_MODIFIER_CLAMP } }
map { input: GAMEPAD_LPAD_RIGHT type: GAMEPAD_TYPE_AXIS index: 3 mod { mod: GAMEPAD_MODIFIER_CLAMP } }
map { input: GAMEPAD_LPAD_DOWN type: GAMEPAD_TYPE_AXIS index: 4 mod { mod: GAMEPAD_MODIFIER_CLAMP } }
map { input: GAMEPAD_LPAD_UP type: GAMEPAD_TYPE_AXIS index: 4 mod { mod: GAMEPAD_MODIFIER_NEGATE } mod { mod: GAMEPAD_MODIFIER_CLAMP } }
map { input: GAMEPAD_LSHOULDER type: GAMEPAD_TYPE_BUTTON index: 4 }
map { input: GAMEPAD_RPAD_LEFT type: GAMEPAD_TYPE_BUTTON index: 3 }
map { input: GAMEPAD_RPAD_RIGHT type: GAMEPAD_TYPE_BUTTON index: 1 }
map { input: GAMEPAD_RPAD_DOWN type: GAMEPAD_TYPE_BUTTON index: 2 }
map { input: GAMEPAD_RPAD_UP type: GAMEPAD_TYPE_BUTTON index: 0 }
map { input: GAMEPAD_RSHOULDER type: GAMEPAD_TYPE_BUTTON index: 5 }
map { input: GAMEPAD_START type: GAMEPAD_TYPE_BUTTON index: 9 }
map { input: GAMEPAD_GUIDE type: GAMEPAD_TYPE_BUTTON index: 8 }
}

Hmm, no idea. @jhonny.goransson or @sven?

I can’t say for sure why it would happen, but I have seen similar issues when gamepads are disconnected and the input system (somehow) keep sending invalid data.

Sadly I think I need to actually sit down and debug it with an actual controller. But I think I have a SNES USB controller at home that I could try with, might have the same issue?

Do you have more information about the NES controller? Like manufacturer, product info etc?

1 Like

It’s a fairly cheap clone, branded iNNEXT. Works fine with a RetroPIE without any additional settings. Any help appreciated.

By the way, I was also surprised at the lack of a predefined GAMEPAD_SELECT constant.

Here’s the product link:
https://www.amazon.de/iNNEXT%C2%AE-Controller-Raspberry-retropie-Emulator-snes-usb/dp/B01EA7MVTQ/

Also works fine with emulators on the Mac.

Hi! Now that 1.2.157 is out, can we get a rebuilt gdc tool that has functional hats?

3 Likes

Doh, yes, of course! I’m at home at the moment so I don’t have access to the binaries currently, but we have talked about them being uploaded to d.defold.com as well in the future… I will hook you up tomorrow though.

4 Likes

Yeah. No rush. Tomorrow I’ll have access to more controllers at the office anyway.

1 Like

Hi britzl!

I’m trying to use gamepad SN30 pro on mac m1 but Defold build shows:
WARNING:INPUT: No gamepad map found for gamepad 0 (DUALSHOCK 4 Wireless Controller). The raw gamepad map will be used.

On mac m1 pro: ./gdc show error: zsh: bad CPU type in executable.

So I don’t know what to do?