How to use an Android gamepad?

Hi!
I’m trying to add a key event to button index for android gamepads:
Снимок экрана 2022-07-13 в 14.04.57

But i have an error:
Снимок экрана 2022-07-13 в 14.05.49

How i can to add these keys Gamepad input in Defold?

AKEYCODE_DPAD_RIGHT is not a defined text trigger constant. What you need to do for gamepad input on Defold is this:

  • Copy the default.gamepads from builtins to a location in your project
  • Change game.project to use the copied file
  • Add a new entry to the gamepads file with the configuration for the new controller.
    • You can learn more about the available buttons in the Android section of the gamepads manual: Gamepad input in Defold

You can also use raw gamepad input:

With raw gamepad input you do not need to create a gamepad configuration. You simply create a single input binding for Raw in the gamepad section of the input bindings.

4 Likes

Thank you so much for this answer and help! I will try it!

1 Like