Android模拟HID键盘

标签 android c++ android-ndk adk

我希望将我的桌面计算机服务器作为 Android 设备的键盘。

根据“Android Open Accessory ”协议(protocol),这应该是可能的:

AOA 2.0 allows the accessory to register one or more USB Human Interface Devices (HID)
with an Android device. This approach reverses the direction of communication for 
typical USB HID devices like USB mice and keyboards. Normally, the HID device is a 
peripheral connected to a USB host like a personal computer. But in the case of the 
AOA protocol, the USB host acts as one or more input devices to a USB peripheral.

我宁愿避免实现 AOA 堆栈,是否有任何现有项目可以在 Windows 操作系统上演示上述用例

如何“反转通信方向”以便注册虚拟 HID 设备?

最佳答案

我已经弄清楚了,最终会将设备切换到配件模式并发送要使用的 HID 报告,然后您只需将带有注册报告 ID 的 HID 消息发送到设备即可。

工作起来就像一个魅力

关于Android模拟HID键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26574707/

相关文章:

android - DrawerLayout 必须使用 MeasureSpec.EXACTLY 错误进行测量

java - 在 Android 上移动 ImageView

android - 在 Android Studio 中指定特定文件夹作为 jni 源的父级

Android - 跟踪 IntentService 中的多个操作

java - 在 Android 4.4.2 上更改短信应用默认设置

c++ - STL 容器的 Const 锁包装器

c++ - Hippomock 中 Expect 调用函数参数中的模板函数

C++ opengl bmp 和 alpha channel

java - 不再支持 Android NDK APP_STL gnuSTL_shared

android - Android 的 c++11 多线程问题,其中某些线程未正确安排