MacOS Virtual Input Devices

和自甴很熟 提交于 2019-12-10 10:54:54

问题


How can I create a virtual HID device in code? I'm trying to avoid writing a kernel extension to accomplish this, but it seems to be the only way. I need to be able to create virtual HID devices of all types, and have an app running in the background feed them events. Is there a way to do this in user-space, or must I venture into kernel land?


回答1:


The typical way of creating HID devices is to use the IOHID* classes in IOKit. You can write a userclient that passes events in and out.

I'm not sure what a "virtual" HID device is, however, I guess. If you want to create a keyboard on the screen, that sort of thing can probably be done in userspace.



来源:https://stackoverflow.com/questions/2894509/macos-virtual-input-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!