We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2268 - Android/OUYA Controller unknown keycodes
Summary: Android/OUYA Controller unknown keycodes
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: ARM Android (All)
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 10:07 UTC by Martin Gerhardy
Modified: 2014-01-25 13:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Gerhardy 2013-11-24 10:07:05 UTC
I/SDL     (11678): Unknown keycode 96
I/SDL     (11678): Unknown keycode 96
I/SDL     (11678): Unknown keycode 99
I/SDL     (11678): Unknown keycode 99
I/SDL     (11678): Unknown keycode 100
I/SDL     (11678): Unknown keycode 100
I/SDL     (11678): Unknown keycode 97
I/SDL     (11678): Unknown keycode 97

The keys on the controller are:
 96 = O
 99 = U
100 = Y
 97 = A
Comment 1 Martin Gerhardy 2013-11-24 10:13:34 UTC
i really wonder why this happens, as they see them handled in keycode_to_SDL

but it looks like my actions did not go through Android_OnPadDown/-Up.

i added the line
__android_log_print(ANDROID_LOG_ERROR,"myown","android pad down %i", keycode); into these functions and don't see any output in the logcat.
Comment 2 Gabriel Jacobo 2013-11-24 17:24:22 UTC
Can you debug what happens on the Java side?
Comment 3 Martin Gerhardy 2013-11-26 12:55:20 UTC
It looks like this is somehow connected with having the xbox 360 controllers connected to the ouya. I wasn't able to debug it further, yet. But as soon as I plug in the xbox controller (getting all 4 slots) and after that the ouya controller. I get weird results.

I still get events for not opened joysticks for example. Maybe that is related to the issue that the keys are reported to be unknown.
Comment 4 Gabriel Jacobo 2013-11-26 16:07:27 UTC
It seems that this can be a side effect of plugging in a controller after initializing the joystick list on the java side.

In SDLActivity.java, onKey function, if SDLActivity.getJoyId( event.getDeviceId() ) is -1, the key will be passed to the keyboard code even if it actually is a gamepad event.
Comment 5 Sam Lantinga 2013-11-27 08:10:36 UTC
FWIW, SDL 2.0 supports hot-plug joysticks, so this is something that would be nice if it worked on Android.
Comment 6 Martin Gerhardy 2014-01-25 13:48:20 UTC
I think this can be closed now. since the hotplugging support is in, it doesn't happen anymore.