New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ouya Controller doesn't fully work #13
Comments
Original comment by Landon “Karai” Manning (Bitbucket: karai17, GitHub: karai17).
This should print out every recognized button on any controller. If a button does not print anything, love/SDL is not registering said button. |
Original comment by Colby Klein (Bitbucket: shakesoda, GitHub: shakesoda). I wasn't getting anything with my Ouya controllers in my testing, googling showed that SDL2 has had some work on controllers (among other things) in Android post-2.0.1 (in HG tip) so this just might be resolvable by bumping the SDL version. |
Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis). I have just updated SDL2 to the latest development version (changeset d4a88c49247e). A new alpha build can be found at http://fysx.org/~martin/shared/love_android_sdl2_alpha5.apk. The gamepad API for Android was introduced with API level 12, therefore it will only 3.1 and above. |
Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis). I fear it requires adjustment of the file https://hg.libsdl.org/SDL/file/2e4f1bd21196/src/joystick/SDL_gamecontrollerdb.h. However I do not have such a controller at hand so I cannot test it. Maybe with help from the SDL2 mailing list a fix could be made. |
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73). You can add / change game controller mappings in SDL with |
Original comment by Carlo Cabanilla (Bitbucket: clofresh, GitHub: clofresh). The ouya controller wasn't working for me as a gamepad until I manually mapped the buttons:
|
Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis). How about the system button? Is it reporting something? Or does it do anything? |
Original comment by Carlo Cabanilla (Bitbucket: clofresh, GitHub: clofresh). The system button doesn't register as anything. This is how I discovered what everything does: https://gist.github.com/clofresh/8531100 |
Original comment by Pavol Rusnak (Bitbucket: prusnak, GitHub: prusnak). I used code from previous comment to create a config for Moga Pro controller.
Digital Pad behaves like two axis 7 & 8, with values -1,0,1. Not sure what the naming conventions for such setup are. Feel free to adapt and push to SDL_gamecontrollerdb.h in SDL2. |
Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73). For
Also keep in mind if doing this that you'll have to account for button/axis/hat indices starting from 1 in LÖVE's API, and from 0 in SDL's (i.e. you'll need to put button 5 instead of button 6 for the 'a' button in the string used by SDL.) |
Original comment by Landon “Karai” Manning (Bitbucket: karai17, GitHub: karai17). Let's all take a moment to reflect on the thought that someone at OUYA deliberately made the menu button on the controller register as a global key press, instead of a joystick-specific button press. This was a design decision. -- imnotsorry.lua
function love.keypressed(key, isrepeat)
if key == "menu" then
love.joystickpressed(1, key)
end
end
function love.joystickpressed(joystick, button)
if button == "menu" then
-- OUYAAAAAAAAAAAAAAAAAAAAAAAAAAA
end
end |
Original comment by Carlo Cabanilla (Bitbucket: clofresh, GitHub: clofresh). Oh weird, glad you figured that out. So that means we won't be able to tell which joystick actually pressed the menu button huh. @karai17: that'll only work work in love 0.8 since 0.9 passes in joystick objects instead of joystick numbers. You'll probably wanna do
|
Original comment by Pavol Rusnak (Bitbucket: prusnak, GitHub: prusnak). JFYI I created bindings for Moga Pro in Steam Big Picture mode as mentioned in https://bugzilla.libsdl.org/show_bug.cgi?id=2357 I think you want to do the same for Ouya controller. |
Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis). So I guess the Ouya controller then works (somewhat mind-boggling), right? At least it does not seem to be an issue of the port, rather of SDL or the controller itself. Feel free to re-open if I did not read correctly or you do not agree. |
Original report by Landon “Karai” Manning (Bitbucket: karai17, GitHub: karai17).
The directional pad seems to work, but other buttons do not. Probably an SDL issue.
The text was updated successfully, but these errors were encountered: