这是不可能同时拥有物理键盘和软键盘在同一时间积极它是通过InputMethodService功能onEvaluateInputViewShown
执行。你可以查看文档here。
/**
* 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() {
所以,除非你实现你自己的IME其中,你可以在此改变onEvaluateInputViewShown它是不可能同时拥有物理和softkeyboard是活跃在同一时间。
关于你最后一个问题,我不确定,但我认为没有办法以编程方式隐藏hardKeyboard。虽然它没有解决方案,但您应该检查this question