@@ -1132,7 +1132,6 @@ public void run(){
1132
1132
1133
1133
public void dispatchCommand (String message ){
1134
1134
1135
- Boolean ret = false ;
1136
1135
int delay = 0 ;
1137
1136
while (message .length () > 50 ){
1138
1137
delayed_message (message .substring (0 , 50 ), delay );
@@ -1146,7 +1145,7 @@ public void dispatchCommand(String message){
1146
1145
1147
1146
if (DEBUG ) Log .d (TAG , String .format ("dispatch :%s" , message ));
1148
1147
int keyCode = 45 ;
1149
- //send control sequence start \x01
1148
+ //send control sequence start
1150
1149
nativeKey (keyCode , 1 , 1 );
1151
1150
nativeKey (keyCode , 0 , 1 );
1152
1151
@@ -1156,18 +1155,28 @@ public void dispatchCommand(String message){
1156
1155
nativeKey (keyCode , 0 , (int ) message .charAt (i ));
1157
1156
}
1158
1157
1159
- //send control sequence start \x01
1158
+ //send control sequence end \x02
1160
1159
nativeKey (keyCode , 1 , 2 );
1161
1160
nativeKey (keyCode , 0 , 2 );
1162
1161
1163
1162
}
1164
1163
1165
1164
@ Override
1166
1165
public InputConnection onCreateInputConnection (EditorInfo outAttrs ) {
1167
- // setting inputtype to TYPE_CLASS_TEXT is necessary for swiftkey to enable
1168
1166
outAttrs .inputType = inputType ;
1169
1167
// ask IME to avoid taking full screen on landscape mode
1170
1168
outAttrs .imeOptions = EditorInfo .IME_FLAG_NO_EXTRACT_UI ;
1169
+
1170
+ // add a listener for the layout chnages to the IME view
1171
+ final android .view .View activityRootView = mActivity .getWindow ().getDecorView ();
1172
+ activityRootView .getViewTreeObserver ().addOnGlobalLayoutListener (new android .view .ViewTreeObserver .OnGlobalLayoutListener () {
1173
+ @ Override
1174
+ public void onGlobalLayout () {
1175
+ //send control sequence start /x04 == kayboard layout changed
1176
+ nativeKey (45 , 1 , 4 );
1177
+ nativeKey (45 , 0 , 4 );
1178
+ }
1179
+ });
1171
1180
return new BaseInputConnection (this , false ){
1172
1181
1173
1182
private void deleteLastText (){
0 commit comments