# pi0-keyboard **Repository Path**: leux/pi0-keyboard ## Basic Information - **Project Name**: pi0-keyboard - **Description**: 用树莓派Zero来当键盘 - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 4 - **Created**: 2019-08-07 - **Last Updated**: 2023-12-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pi0-keyboard #### 介绍 使用树莓派Zero来模拟键盘,鼠标,摇杆等 #### 架构 1. 硬件:raspberry zero w,理论上rpi zero也可运行。 2. 系统:2019-07-10-raspbian-buster-lite #### 安装 1. 下载本项目至你的设备 2. 后面命令请通通以root用户执行 3. 运行脚本 setup_install.sh 来安装 4. 运行脚本 test.sh 测试安装是否成功 #### 使用 1. 安装成功后插入电脑,启动派看电脑上是否多了个键盘设备 2. 使用命令:` echo -ne "\0\0\x4\0\0\0\0\0\0\0\0\0\0\0\0\0" > /dev/hidg0 ` 来输出一个a 3. 编译hid-gadget-test.c 后可以使用命令:` ./hid-gadget-test /dev/hidg0 kerboard ` 来启动个键盘测试程序 4. 启动 hid-gadget-test 后 输入a回车即可看到电脑上按下了a键,其他键位请看 hid-gadget-test -h #### 贡献 1. Fork From https://github.com/c4software/pi-as-keyboard 2. https://github.com/girst/hardpass-sendHID 3. http://www.isticktoit.net/?p=1383 4. https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt 5. 参考以上链接适配最新系统