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 2031 - Backspace and Return Not Sending Events From On-Screen Keyboard
Summary: Backspace and Return Not Sending Events From On-Screen Keyboard
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.0
Hardware: ARM Android (All)
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-12 12:28 UTC by Joe LeVeque
Modified: 2013-11-11 14:00 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 Joe LeVeque 2013-08-12 12:28:39 UTC
After starting up the on-screen keyboard in Android, events are received for all character keys, but no events are received for the Backspace or Enter/Return keys. I have set a breakpoint in my event loop and proven that I receive no events whatsoever for Backspace or Enter/Return.
Comment 1 Gabriel Jacobo 2013-08-22 14:15:33 UTC
I just verified and I get SDL_KEYUP / SDL_KEYDOWN events with keycode 8 (BACKSPACE) and 13 (ENTER), and SDL_TEXTINPUT events for regular characters. Is this the way it's supposed to work?
Comment 2 Joe LeVeque 2013-08-22 16:08:40 UTC
On 8/20 I updated my source to the latest hg snapshot, and I noticed that the ENTER key was now having an effect in my app (but not BACKSPACE), so I went to debug my app to see what events were now being received, but unfortunately I had also just updated my device to Android 4.3, in which I found that Google has included a beautiful bug that completely breaks native code debugging (see the bug report here: https://code.google.com/p/android/issues/detail?id=58373). I'm waiting for a fix from Google and in the meantime trying to find a workaround so I can debug my app again. :(
Comment 3 Gabriel Jacobo 2013-08-22 16:16:41 UTC
What happened to good old __android_log_print ? :)

That's actually what I did to test this, on the key up, down and text input events, I added a print command to see what's arriving from the keyboard. And that seemed to work (I'm also on Android 4.3)
Comment 4 Joe LeVeque 2013-08-22 17:29:01 UTC
OK - you got me ;) I've been busy with other things, and I also need to get the debugger working for other issues, so I did kinda put this issue on the back burner. Anyway, I added an __android_log_print, and I verified that I am now receiving SDL_KEYUP / SDL_KEYDOWN events for ENTER, but still no event at all for BACKSPACE. However, I am seeing a new message in the logcat whenever BACKSPACE is pressed:

08-22 12:23:26.451: E/LatinIME(1259): Backspace when we don't know the selection position

Again, I am running SDL from changeset 7659.
Comment 5 Gabriel Jacobo 2013-08-22 17:33:58 UTC
For reference: http://forum.unity3d.com/threads/161471-Backspace-key-of-screen-keyboard-not-work

I'm using Swiftkey which probably explains why I'm not seeing the problem.
Comment 6 Joe LeVeque 2013-08-22 17:46:26 UTC
Gabriel - good find! At least I know I'm not crazy! It's good to know other people are looking into this as well, but it seems like a pretty nasty issue. Here's hoping there's a simple solution.
Comment 7 Joe LeVeque 2013-11-06 19:19:45 UTC
FYI, Looks like this might be a possible explanation/solution:

http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection
Comment 8 Gabriel Jacobo 2013-11-11 14:00:05 UTC
Should be fixed now, thanks for the research! https://hg.libsdl.org/SDL/rev/b8f431cd7819