是否可以将 Android 编程为物理 USB 键盘?

2023-01-30移动开发问题
10

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

The End

相关推荐

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?
How can i use MYSQL database connection in iphone application useing cocos2d?(如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?)...
2024-08-12 移动开发问题
5

在 cocos2d 中平滑拖动一个 Sprite - iPhone
Smoothly drag a Sprite in cocos2d - iPhone(在 cocos2d 中平滑拖动一个 Sprite - iPhone)...
2024-08-12 移动开发问题
10

CCScrollView 滚动和触摸事件永远不会触发
CCScrollView scroll and touch events never firing(CCScrollView 滚动和触摸事件永远不会触发)...
2024-08-12 移动开发问题
1

使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘
removing jagged edges of my ropes using antialiasing of OpenGLES(使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘)...
2024-08-12 移动开发问题
34

cocos2d 在场景之间移动
cocos2d Moving between scene(cocos2d 在场景之间移动)...
2024-08-12 移动开发问题
2