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 4906 - Pressing Back button terminates app after SDL_StartTextInput
Summary: Pressing Back button terminates app after SDL_StartTextInput
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: ARM Android (All)
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-19 05:31 UTC by Miku AuahDark
Modified: 2019-12-19 14:44 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 Miku AuahDark 2019-12-19 05:31:26 UTC
Hello, this is my first time filling a bug.

I noticed a problem when I call function to show the on-screen keyboard and hide it again, I didn't receive "Back" button key event (keyup/down) and the app exit instead (but not crash as I receive the quit event). If I set `SDL_ANDROID_TRAP_BACK_BUTTON` hint, the app didn't exit but I didn't receive "Back" button key event either.

This is similar to #4702 but the difference is that I only encounter this issue AFTER calling "SDL_StartTextInput". This means that if I didn't call this function, I receive "Back" button key event correctly, even without the hint described above. As I'm testing this with changeset 472db3f71645 (tip as of writing), this means the fix there isn't effective to me.

My device is Mi A1 running Android 9 unrooted. I can add traces to the SDL code if needed.
Comment 1 Sylvain 2019-12-19 12:54:05 UTC
I think this is fixed with:
https://hg.libsdl.org/SDL/rev/381ddcd3957c

When the text input is hidden, we need to set back the focus on mSurface
Please let me know
Comment 2 Miku AuahDark 2019-12-19 14:44:10 UTC
Didn't know the fix is that simple. Thanks, it now properly capture "Back" button as escape again.