Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 可以同时激活物理键盘和软键盘吗?_Android_Android Input Method - Fatal编程技术网

Android 可以同时激活物理键盘和软键盘吗?

Android 可以同时激活物理键盘和软键盘吗?,android,android-input-method,Android,Android Input Method,我的应用程序需要同时激活两个输入源:条形码扫描仪和软键盘。当我配对蓝牙扫描仪时,它被视为一个物理键盘。因此,当连接此设备时,软键盘不会显示(软键盘被禁用) 可以同时激活物理键盘和软键盘吗? 如果没有,解决问题的最佳方法是什么?我是否必须实现一个接收按键事件的自定义视图?市场上有没有这样的键盘应用程序 如何以编程方式打开和关闭物理键盘?这是切换按钮“使用物理键盘”设置(我在这里找到了此设置的屏幕截图: 物理键盘和软键盘不可能同时处于活动状态。它是通过InputMethodService功能OneV

我的应用程序需要同时激活两个输入源:条形码扫描仪和软键盘。当我配对蓝牙扫描仪时,它被视为一个物理键盘。因此,当连接此设备时,软键盘不会显示(软键盘被禁用)

可以同时激活物理键盘和软键盘吗? 如果没有,解决问题的最佳方法是什么?我是否必须实现一个接收按键事件的自定义视图?市场上有没有这样的键盘应用程序

如何以编程方式打开和关闭物理键盘?这是切换按钮“使用物理键盘”设置(我在这里找到了此设置的屏幕截图:


物理键盘和软键盘不可能同时处于活动状态。它是通过InputMethodService功能
OneValuateInputViewShowed
强制执行的。您可以查看文档

因此,除非您正在实现自己的IME,其中您可以跳过OneValuageInputViewShow,否则物理键盘和软键盘不可能同时处于活动状态

关于你的最后一个问题,我不确定,但我认为没有办法通过编程隐藏硬键盘。虽然它没有解决方案,但你应该检查一下

/**
 * Override this to control when the soft input area should be shown to
 * the user.  The default implementation only shows the input view when
 * there is no hard keyboard or the keyboard is hidden.  If you change what
 * this returns, you will need to call {@link #updateInputViewShown()}
 * yourself whenever the returned value may have changed to have it
 * re-evaluated and applied.
 */
public boolean onEvaluateInputViewShown() {