以下方法可以在插入物理键盘的同事,在显示屏上显示软键盘:
修改base/services/input/EventHub.cpp文件中的函数:
openDeviceLocked(......)
在
1058 // If the device isn't recognized as something we handle, don't monitor it.
1059 if (device->classes == 0) { 1060 LOGV("Dropping device: id=%d, path='%s', name='%s'", 1061 deviceId, devicePath, device->identifier.name.string()); 1062 delete device; 1063 return -1; 1064 } 之前添加以下一行即可:device->classes &= 0xFFFF & ~INPUT_DEVICE_CLASS_ALPHAKEY;
编译后生成libinput.so,替换掉/system/lib/的同名文件即可。