Fix some Android keyboards that didn't work properly.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 15 Oct 2015 12:52:00 -0400
changeset 9894 b98c133b5cfd
parent 9893 d3ad01d50bf0
child 9895 5725b4f2e79b
Fix some Android keyboards that didn't work properly. This conversation came from Joshua Granick on Twitter, starting here: https://twitter.com/singmajesty/status/653640543675641857 "We found an issue where certain Android keyboards (like the S6 with predictive text) wouldn't work ... Certain keyboards use a predictive text mode that does not dispatch a traditional onKey events, which is troublesome ... but telling the OS to use a "visible password" keyboard helps deal with this problem ... perhaps there's some other way (onKeyPreIme?) to do "textediting" events, but for now, this should be a fast fix ... I hear it affects the Galaxy Tab A 8.0", Galaxy S6, Asus ZenPhone 2, maybe others"
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Oct 07 21:18:08 2015 +0200
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Thu Oct 15 12:52:00 2015 -0400
@@ -1393,6 +1393,7 @@
     public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
         ic = new SDLInputConnection(this, true);
 
+        outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
         outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
                 | 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */;