<分区>
我有一个 android 应用程序,它处理来自标准键盘的输入与 Swype 键盘提供的输入不同。有没有办法以编程方式找出当前正在使用的键盘?
谢谢!
<分区>
我有一个 android 应用程序,它处理来自标准键盘的输入与 Swype 键盘提供的输入不同。有没有办法以编程方式找出当前正在使用的键盘?
谢谢!
最佳答案
获得它的最佳方法是使用 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
关于android - 检测虚拟键盘类型-android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16065948/