Trouble mapping joystick hats using setGamepadMapping

Issue #81 resolved
Robinson Taylor created an issue

So I'm trying to configure a my game to work with a Moga controller and I'm having trouble. It seems there's a bug in how it parses the hat parameter of setGamepadMapping - I finally thought to use getGamepadMapping to check where things were getting mapped to, and even though I tell it to map, say, "dpup" to hat 1, "u" direction, it seems to think I'm trying to map it to an imaginary hat 3 instead. Mapping it to "r" just to test makes it map to hat 4, and so on. This is the first time I've ever used setGamepadMapping, since Love2D recognizes Xbox controllers by default, but I'm pretty sure I'm using it correctly. The weirdest thing is, this makes it crash:

love.joystick.setGamepadMapping(joystick:getGUID(),"dpdown","hat",1,"d")

I'm looking into the code myself to try and figure out what might be wrong, but C++ and Java aren't my areas of proficiency. ^_^;

Comments (8)

  1. Robinson Taylor reporter

    ndk-build gives me an error when I try to compile. Something about wrap_File.cpp, line 239.

  2. Martin Felis repo owner

    Run ndk-build clean first. Some files were removed and ndk-build is unfortunately not smart with that.

  3. Log in to comment