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 3424 - SDL_GameController: Increase k_nMaxReverseEntries
Summary: SDL_GameController: Increase k_nMaxReverseEntries
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: All Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-14 20:58 UTC by ny00
Modified: 2016-10-02 14:16 UTC (History)
0 users

See Also:


Attachments
Patch (439 bytes, patch)
2016-09-14 20:58 UTC, ny00
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ny00 2016-09-14 20:58:35 UTC
Created attachment 2561 [details]
Patch

On Android, the keycodes KEYCODE_BUTTON_1..16 (actual values 188-203) are translated to SDL_Joystick buttons no. 20-35. These are currently ignored in SDL_gamecontroller.c.

The attached patch fixes this, by increasing k_nMaxReverseEntries from 20 to another arbitrary bound of 48.

Side-note: Maybe some log should be emitted in case of going over any such bound?
Comment 1 Sam Lantinga 2016-10-01 20:02:49 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/c5b42350ccbb

Agreed on your side note. Would you like to submit another bug and patch to cover that?
Comment 2 ny00 2016-10-02 14:16:51 UTC
(In reply to Sam Lantinga from comment #1)
> Fixed, thanks!
> https://hg.libsdl.org/SDL/rev/c5b42350ccbb

Great, more game controllers' features should be usable now!

> Agreed on your side note. Would you like to submit another bug and patch to
> cover that?

Done! See bug 3438.