How can I get game controllers to work in Android?

skepskep Posts: 4Member

I've done some googling and some searching here and about all I can find is this bug report which ends with a comment about being added to a 3.2 milestone: https://github.com/godotengine/godot/issues/25151

Obviously there is no 3.2 release date, but as far as I know 3.2 isn't even in alpha release so I'm guessing it's not going to be anytime soon. Unfortunately programming a fix in Godot is beyond me, but if someone else has patched it I can take a stab at recompiling. I'm not even sure if it's the Android template or Godot or both that need rebuilt.

What I do know is no controller = no Android TV.


Tags :

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 1,721
    Accepted Answer

    Godot daily builds are, for the most part, fairly stable. I would always keep a backup and use source control just in case, but it should probably be okay for the most part. I wouldn't recommend starting a multi-month long project with a daily build, but especially for prototyping it shouldn't be too much of an issue.

    The fix should be in the dailies, since the PR containing the fix was pulled in around May 4th (first PR) and May 28th (second PR). Unfortunately, I do not have an Android device, nor an Android gamepad, so I cannot say for sure whether it has been fixed or not.
    If it does fix the issue, then it might be cherry picked for Godot 3.2, which would mean the wait to get an official Godot build with the fix would be much shorter.

    Though if the issue is still present in the daily builds, I would highly recommend opening a issue on GitHub, after checking to make sure none for the issue are already open, so it can be hopefully be fixed in the future.

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 1,721Admin

    If you don't want to go through recompiling the engine yourself, you can use a nightly/development build of Godot. This topic on the forums lists a few resources for nightly/development builds.

    I personally use Calinou's nightly builds, which include export templates for Windows, Linux, Android, and HTML5 all in one download (with MacOS and iOS in another download)

  • skepskep Posts: 4Member

    Thanks for the heads up. I ran across those, but I really wasn't sure if moving to a daily would break more things than fix. You wouldn't happen to know if the android gamepad issue is fixed in the dailies would you? I found the 3.2 milestones, but didn't see anything about android gamepad at all let alone if it's been fixed or not.

    If nobody knows if it's fixed in the dailies I'll try to test it later.

  • TwistedTwiglegTwistedTwigleg Posts: 1,721Admin
    Accepted Answer

    Godot daily builds are, for the most part, fairly stable. I would always keep a backup and use source control just in case, but it should probably be okay for the most part. I wouldn't recommend starting a multi-month long project with a daily build, but especially for prototyping it shouldn't be too much of an issue.

    The fix should be in the dailies, since the PR containing the fix was pulled in around May 4th (first PR) and May 28th (second PR). Unfortunately, I do not have an Android device, nor an Android gamepad, so I cannot say for sure whether it has been fixed or not.
    If it does fix the issue, then it might be cherry picked for Godot 3.2, which would mean the wait to get an official Godot build with the fix would be much shorter.

    Though if the issue is still present in the daily builds, I would highly recommend opening a issue on GitHub, after checking to make sure none for the issue are already open, so it can be hopefully be fixed in the future.

  • skepskep Posts: 4Member

    That did it, thanks! Well, still not working quite right on my Shield TV for some reason. Both my linux desktop and my android TV see InputEventJoypadButton: 0 for example, but where the linux PC maps it to "ui_accept" the android TV doesn't appear to map it at all. However, Android TV DOES see game controller input so I can work with that.

    Thanks!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file