{"id":20759754,"url":"https://github.com/najmajmal-old/pi400kb","last_synced_at":"2026-04-25T09:32:37.405Z","repository":{"id":162682402,"uuid":"637177411","full_name":"NajmAjmal-old/pi400kb","owner":"NajmAjmal-old","description":"Raspberry pi 400 as a Keyboard","archived":false,"fork":false,"pushed_at":"2023-05-22T06:39:29.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T05:16:58.773Z","etag":null,"topics":["400","keyboard","pi400","pi400kb","raspberry","raspberry-pi","raspberry-pi-400","raspberrypi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NajmAjmal-old.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-06T18:42:24.000Z","updated_at":"2023-05-22T06:38:24.000Z","dependencies_parsed_at":"2023-12-09T10:39:27.371Z","dependency_job_id":null,"html_url":"https://github.com/NajmAjmal-old/pi400kb","commit_stats":null,"previous_names":["najmajmal-old/pi400kb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NajmAjmal-old%2Fpi400kb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NajmAjmal-old%2Fpi400kb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NajmAjmal-old%2Fpi400kb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NajmAjmal-old%2Fpi400kb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NajmAjmal-old","download_url":"https://codeload.github.com/NajmAjmal-old/pi400kb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243076513,"owners_count":20232433,"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":["400","keyboard","pi400","pi400kb","raspberry","raspberry-pi","raspberry-pi-400","raspberrypi"],"created_at":"2024-11-17T10:08:07.842Z","updated_at":"2026-04-25T09:32:32.358Z","avatar_url":"https://github.com/NajmAjmal-old.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi 400 as 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.\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\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- [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\n`wget https://github.com/NajmAjmal/pi400kb/blob/main/pi400kb`\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/sbin/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\n## Building \u0026 Contributing\n\n### Building\n\n```\nsudo apt install libconfig-dev\ngit clone https://github.com/NajmAjmal/pi400kb\ncd pi400kb\ngit submodule update --init\nmkdir build\ncd build\ncmake ..\nmake\n```\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\nCredits: Gadgetoid\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnajmajmal-old%2Fpi400kb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnajmajmal-old%2Fpi400kb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnajmajmal-old%2Fpi400kb/lists"}