我知道如何从物理键盘获取 KeyEvent,但如何从软键盘获取它们?
此代码不适用于软键盘:
editText.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
Toast.makeText(this, Integer.toString(keyCode), Toast.LENGTH_SHORT)
return false;
}
});