检测虚拟键盘的类型-Android
答
最好的方法是使用InputDeviceId。
int[] devicesIds = InputDevice.getDeviceIds();
for (int deviceId : devicesIds) {
//Check the device you want
InputDevice device = InputDevice.getDevice(deviceId);
//device.getName must to have virtual
//That check the keyboard type
device.getKeyboardType(); //returns an int
}
参考:
https://developer.android.com/reference/android/view/InputDevice.html#getKeyboardType%28%29
可能重复:http://*.com/questions/3380234/android-determine-active-input-method-from-code –
是的!我之前搜索过它,但无法找到这样的帖子。谢谢! :) –