硬件接上USB扫描枪后,被认为是一个USB物理键盘,这时候,系统会默认关闭软键盘。
通过如下方法可以让软硬键盘都打开。
kris@eco:~/rk3288/frameworks/base$ g df core/java/android/inputmethodservice/InputMethodService.java
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 61e02fd..11b8c7a 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1157,8 +1157,12 @@ public class InputMethodService extends AbstractInputMethodService {
*/
public boolean onEvaluateInputViewShown() {
Configuration config = getResources().getConfiguration();
+ /*
return config.keyboard == Configuration.KEYBOARD_NOKEYS
|| config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES;
+ */
+
+ return true;
}
/**
硬件接上USB扫描枪后,被认为是一个USB物理键盘,这时候,系统会默认关闭软键盘。
通过如下方法可以让软硬键盘都打开。
kris@eco:~/rk3288/frameworks/base$ g df core/java/android/inputmethodservice/InputMethodService.java
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 61e02fd..11b8c7a 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1157,8 +1157,12 @@ public class InputMethodService extends AbstractInputMethodService {
*/
public boolean onEvaluateInputViewShown() {
Configuration config = getResources().getConfiguration();
+ /*
return config.keyboard == Configuration.KEYBOARD_NOKEYS
|| config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES;
+ */
+
+ return true;
}
/**
举报