{"id":14868561,"url":"https://github.com/Gadgetoid/pi400kb","last_synced_at":"2025-09-19T05:31:21.322Z","repository":{"id":41459110,"uuid":"416663365","full_name":"Gadgetoid/pi400kb","owner":"Gadgetoid","description":"Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard","archived":false,"fork":false,"pushed_at":"2023-08-06T10:40:03.000Z","size":700,"stargazers_count":287,"open_issues_count":35,"forks_count":38,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-01-07T05:14:00.003Z","etag":null,"topics":["hid","keyboard","otg","pi400","usb"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gadgetoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"gadgetoid","patreon":"gadgetoid","open_collective":null,"ko_fi":"gadgetoid","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-10-13T09:03:39.000Z","updated_at":"2025-01-06T14:11:09.000Z","dependencies_parsed_at":"2024-10-13T01:03:56.826Z","dependency_job_id":"d8e7d6a2-1f51-4a16-971f-0ae8dbaa6aa1","html_url":"https://github.com/Gadgetoid/pi400kb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gadgetoid%2Fpi400kb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gadgetoid%2Fpi400kb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gadgetoid%2Fpi400kb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gadgetoid%2Fpi400kb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gadgetoid","download_url":"https://codeload.github.com/Gadgetoid/pi400kb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233553761,"owners_count":18693313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hid","keyboard","otg","pi400","usb"],"created_at":"2024-09-20T06:01:09.548Z","updated_at":"2025-09-19T05:31:21.312Z","avatar_url":"https://github.com/Gadgetoid.png","language":"C","funding_links":["https://github.com/sponsors/gadgetoid","https://patreon.com/gadgetoid","https://ko-fi.com/gadgetoid"],"categories":["C"],"sub_categories":[],"readme":"# Raspberry Pi 400 and Pi 500as a USB HID Keyboard \u0026 Mouse \u003c!-- omit in toc --\u003e\n\nHook your Pi 400 up to your PC somehow, using a USB Type-C cable into the *power* port of the Pi.\nAnker make good ones- I used a 3m white one for my tests.\n\nOur USB-C to USB-A is great if you're using a USB-A port (but make sure it's a *high power* one): https://shop.pimoroni.com/products/usb-c-to-usb-a-cable-1m-black\n\nA Raspberry Pi Mouse is also supported if plugged in, eg: https://shop.pimoroni.com/products/raspberry-pi-mouse?variant=29390982119507\n\n:warning: The Pi 400 and Pi 500 are power hungry, in some cases your computer may not supply enough current, or trigger a low voltage warning.\n\nYou may need to *inject* additional power from an official supply, using something like this: https://thepihut.com/products/usb-c-data-power-splitter\n\n## Contents \u003c!-- omit in toc --\u003e\n\n- [Quickstart (Ish)](#quickstart-ish)\n  - [Mouse Support](#mouse-support)\n- [Building \u0026 Contributing](#building--contributing)\n  - [Building](#building)\n  - [Custom Mouse/Keyboard Devices](#custom-mousekeyboard-devices)\n\n## Quickstart (Ish)\n\nAdd `dtoverlay=dwc2` to `/boot/config.txt`\n\nReboot!\n\n`sudo modprobe libcomposite`\n\nGrab the latest pi400kb for your system from releases: https://github.com/Gadgetoid/pi400kb/releases\n\n`chmod +x pi400kb`\n\n`sudo ./pi400kb`\n\n:sparkles: YOUR PI 400 IS NOW A FREAKING KEYBOARD \u0026 MOUSE FOR YOUR PC WHAAAAT!? :sparkles: \n\nYour keyboard input will be detached from your Pi while it's forwarded to your host computer.\n\nPress `Ctrl + Raspberry` to grab/release your keyboard and mouse, switching between local use and USB.\n\nPress `Ctrl + Shift + Raspberry` (on the grabbed keyboard) to exit.\n\n### Mouse Support\n\nPi 400 KB supports the official Raspberry Pi Mouse VID:PID = 093a:2510 by default, but other mice should work.\n\n### Autostart\n\n```\nsudo cp pi400kb /usr/bin/pi400kb\nsudo systemctl edit --force --full pi400kb.service\n```\n\nAdd the contents of the `pi400kb.service` file.\n\nStart the service and check its status:\n\n```\nsudo systemctl start pi400kb.service\nsudo systemctl status pi400kb.service\n```\n\nEnable start on boot if it's okay:\n\n```\nsudo systemctl enable pi400kb.service\n```\n\nFinally copy pi400kb.conf into /etc/modules-load.d/:\n\n```\nsudo cp pi400kb.conf /etc/modules-load.d/\n```\n\n## Building \u0026 Contributing\n\n### Building\n\n```\nsudo apt install libconfig-dev git cmake\ngit clone https://github.com/Gadgetoid/pi400kb\ncd pi400kb\ngit submodule update --init\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n### Building for Pi 500\n\nReplace the `cmake ..` command above with:\n\n```\ncmake .. -DKEYBOARD_VID=0x2e8a -DKEYBOARD_PID=0x0010 -DKEYBOARD_DEV=/dev/input/by-id/usb-Raspberry_Pi_Ltd_Pi_500_Keyboard-event-kbd\n```\n\n(thanks to 57r31 for the above command)\n\n### Custom Mouse/Keyboard Devices\n\nCMake accepts the following build arguments to customise the VID/PID and device path for the mouse/keyboard:\n\n* `KEYBOARD_VID` - Keyboard Vendor ID, default: 0x04d9\n* `KEYBOARD_PID` - Keyboard Product ID, default: 0x0007\n* `KEYBOARD_DEV` - Keyboard device path, default: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd\n* `MOUSE_VID` - Mouse Vendor ID, default: 0x093a\n* `MOUSE_PID` - Mouse Product ID, default: 0x2510\n* `MOUSE_DEV` - Mouse device path, default: /dev/input/by-id/usb-PixArt_USB_Optical_Mouse-event-mouse\n\nSupply these arguments when configuring with CMake, eg:\n\n```\ncmake .. -DMOUSE_DEV=\"/dev/input/by-id/usb-EndGameGear_XM1_Gaming_Mouse_0000000000000000-event-mouse\" -DMOUSE_VID=0x3367 -DMOUSE_PID=0x1903\n```\n\n## Info\n\nThis project started out life as a gist - https://gist.github.com/Gadgetoid/5a8ceb714de8e630059d30612503653f\n\nThank you to all the people who dropped by with kind words, suggestions and improvements.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGadgetoid%2Fpi400kb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGadgetoid%2Fpi400kb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGadgetoid%2Fpi400kb/lists"}