mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-18 04:20:11 -07:00
Disable enhanced soft input if hardware keyboard is present
This commit is contained in:
parent
65a64402eb
commit
d340b1d6a8
3 changed files with 18 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.content.*;
|
||||
import android.content.res.Configuration;
|
||||
import android.text.Editable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.util.*;
|
||||
|
|
@ -30,14 +31,20 @@ public class MinecraftGLView extends TextureView
|
|||
@Override
|
||||
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||
outAttrs.inputType = EditorInfo.TYPE_NULL;
|
||||
Log.d("EnhancedTextInput","Context: " + ctx);
|
||||
return new MyInputConnection(this,false);
|
||||
if(!isHardKB(this.getContext())) {
|
||||
return new MyInputConnection(this, false);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIsTextEditor() {
|
||||
return false;
|
||||
}
|
||||
public static boolean isHardKB(Context ctx) {
|
||||
return ctx.getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY;
|
||||
}
|
||||
}
|
||||
class MyInputConnection extends BaseInputConnection {
|
||||
private SpannableStringBuilder _editable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue