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 2216 - [Android] Duplicate button presses
Summary: [Android] Duplicate button presses
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: All Android (All)
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 13:54 UTC by ny00
Modified: 2013-11-10 17:21 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 ny00 2013-11-07 13:54:42 UTC
Concerning the recent inclusion of joystick support for Android, it is the case that the testjoystick app reports dual button presses. That is, once a gamepad button is pressed, it reports two buttons getting pressed. When released, both are reported as released.

After modifying the java file a bit, it seems like the reason is as follows:

Concerning the function onKey, if a gamepad button press/release is detected, the value of 'true' is *not* returned as expected. Rather, 'false' is returned.

This may result in an additional, synthesized KeyEvent with keycode KEYCODE_DPAD_CENTER, as hinted here:

http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_CENTER


So, the fix is: Always return 'true' after handling a gamepad button.
Comment 1 Gabriel Jacobo 2013-11-10 17:21:44 UTC
It seems this got fixed here: http://hg.libsdl.org/SDL/rev/8cff978e06e9