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 4191 - SDL_StartTextInput() mangles Android joystick input
Summary: SDL_StartTextInput() mangles Android joystick input
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 2.0.7
Hardware: ARM Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-08 13:09 UTC by RobLM
Modified: 2018-06-09 13:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RobLM 2018-06-08 13:09:10 UTC
Joystick (game controller) events are limited and mangled after calling SDL_StartTextInput() on Android. This might be due to the OS entering 'text input mode'. Apps also generate a lot of ANRs (6000ms UI timeout warnings) while processing joystick events afterwards.

On my phone and game controller only the left stick and D-pad generate any events in the mangled mode, with the D-pad sending wrong axis IDs. The adb log is also spammed with ANRs.

I solved this by adding:
mLayout.removeView(mTextEdit);

To the SDLActivity SDLCommandHandler 'COMMAND_TEXTEDIT_HIDE' case so the DummyEdit is completely removed from the UI stack. This way regular joystick control resumes after finishing text entry. It would be nice however to find a way to make joystick buttons and axes work during text entry as well.
Comment 1 RobLM 2018-06-09 13:30:50 UTC
After more testing, it turns out that my previous fix prevents the soft keyboard showing for successive calls to SDL_StartTextInput().

Unfocusing the text field using 'mLayout.requestFocus();' seems to work as a better fix. It re-enables joystick events and doesn't permanently hide the soft keyboard.