Is it possible to program Android to act as physical USB keyboard?(是否可以将 Android 编程为物理 USB 键盘?)
问题描述
我真正想知道的是这是硬件问题,还是软件问题.我可以通过 USB 将我的安卓手机插入电脑并让它充当硬件键盘吗?我不想在电脑上安装任何东西,我希望 android 表现得像标准硬件.
What I really want to know is whether it is a hardware problem, or a software problem. Could I plug my android phone into a computer via USB and have it act as a hardware keyboard. I do not want to install anything on the computer, I want android to behave like the standard hardware.
澄清我想为 android 编写一个程序/库,使设备能够完全模拟普通键盘,以便操作系统将其报告为标准键盘设备,并且它可以在 BIOS 或其他任何键盘工作的地方工作.
Clarification I want to write a program/library for android that enables the device to fully emulate an ordinary keyboard, so that the operating system reports it as a standard keyboard device, and it would work in the BIOS or anywhere else that a keyboard works.
推荐答案
我在 Nexus 7 上修改了内核,使其像标准 HID 键盘和鼠标一样工作,而不会丢失 MTP/ADB/其他 USB 功能.
I've modified kernel on Nexus 7 to act like standard HID keyboard and mouse, without losing MTP/ADB/other USB functionality.
您可以使用 usb-gadget-test 命令行实用程序将击键和鼠标移动发送到您的 PC.我想稍后创建一个远程管理应用程序,它将发送关键事件并从相机接收视频.
You can use usb-gadget-test commandline utility to send keystrokes and mouse movements to your PC. I want to create a remote admin app later, which will send key events and receive video from camera.
内核补丁、二进制文件和说明:https://github.com/pelya/android-keyboard-gadget
Kernel patch, binaries and instructions: https://github.com/pelya/android-keyboard-gadget
我已经向 Google Play 发布了一个合适的应用,如果您的 Nexus 7 已植根,您可以直接从应用程序中刷新内核,并使用它发送按键.
I've published a proper app to Google Play, if your Nexus 7 is rooted you can flash kernel right from the app, and send keypresses with it.
这篇关于是否可以将 Android 编程为物理 USB 键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以将 Android 编程为物理 USB 键盘?
基础教程推荐
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01