@@ -276,9 +276,6 @@ private void printConfig(EGL10 egl, EGLDisplay display,
276
276
// Is Python ready to receive input events?
277
277
static boolean mInputActivated = false ;
278
278
279
- // Is Composing text being repeated?
280
- static boolean mComposingText = false ;
281
-
282
279
// The number of times we should clear the screen after swap.
283
280
private int mClears = 2 ;
284
281
@@ -475,7 +472,6 @@ public void onDestroy() {
475
472
InputMethodManager inputMethodManager = (InputMethodManager )getContext ().getSystemService (Context .INPUT_METHOD_SERVICE );
476
473
inputMethodManager .hideSoftInputFromInputMethod (this .getWindowToken (), 0 );
477
474
478
-
479
475
// application didn't leave, give 10s before closing.
480
476
// hopefully, this could be enough for launching the on_stop() trigger within the app.
481
477
mPause = PAUSE_STOP_REQUEST ;
@@ -877,7 +873,6 @@ public int swapBuffers() {
877
873
878
874
private static final int INVALID_POINTER_ID = -1 ;
879
875
private int mActivePointerId = INVALID_POINTER_ID ;
880
- private static String mCompText = "" ;
881
876
882
877
@ Override
883
878
public boolean onTouchEvent (final MotionEvent event ) {
@@ -987,14 +982,6 @@ public boolean onKeyMultiple(int keyCode, int count, KeyEvent event){
987
982
}
988
983
if (mInputActivated && event .getAction () == KeyEvent .ACTION_MULTIPLE ){
989
984
keys .getChars (0 , keys .length (), keysBuffer , 0 );
990
- if (mComposingText == true ){
991
- mComposingText = false ;
992
- this .mCompText = keys ;
993
- }else if (this .mCompText .equals (keys )){
994
- // skip on composing text
995
- this .mCompText = "" ;
996
- return true ;
997
- }
998
985
999
986
for (char c : keysBuffer ){
1000
987
//Log.i("python", "Char from multiply " + (int) c);
@@ -1030,31 +1017,15 @@ public boolean onKeyPreIme(int keyCode, final KeyEvent event){
1030
1017
1031
1018
@ Override
1032
1019
public InputConnection onCreateInputConnection (EditorInfo outAttrs ) {
1033
- outAttrs .inputType = EditorInfo .TYPE_NULL ;
1034
- return new BaseInputConnection (this , false ) {
1035
-
1036
- @ Override
1037
- public boolean setComposingText (CharSequence text ,
1038
- int newCursorPosition ) {
1039
- commitText (text , 0 );
1040
- mComposingText = true ;
1041
- sendKeyEvent (
1042
- new KeyEvent (
1043
- KeyEvent .ACTION_DOWN ,
1044
- KeyEvent .KEYCODE_SPACE ));
1045
- sendKeyEvent (
1046
- new KeyEvent (
1047
- KeyEvent .ACTION_UP ,
1048
- KeyEvent .KEYCODE_SPACE ));
1049
- //Log.i("Python:", String.format("set Composing Text %s", mComposingText));
1050
- return true ;
1051
- }
1052
- };
1020
+ // setting inputtype to TYPE_CLASS_TEXT is necessary for swiftkey to enable
1021
+ outAttrs .inputType = EditorInfo .TYPE_CLASS_TEXT ;
1022
+ // ask IME to avoid taking full screen on landscape mode
1023
+ outAttrs .imeOptions = EditorInfo .IME_FLAG_NO_EXTRACT_UI ;
1024
+ return new BaseInputConnection (this , false );
1053
1025
}
1054
1026
1055
1027
static void activateInput () {
1056
1028
mInputActivated = true ;
1057
- mComposingText = false ;
1058
1029
}
1059
1030
1060
1031
static void openUrl (String url ) {
0 commit comments