是否可以将 Android 编程为物理 USB 键盘? [英] Is it possible to program Android to act as physical USB keyboard?

查看:20
本文介绍了是否可以将 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 键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆