{"id":25178076,"url":"https://github.com/twosquirrels/virtual-gamepad","last_synced_at":"2026-05-07T13:06:51.388Z","repository":{"id":247517177,"uuid":"826049611","full_name":"TwoSquirrels/virtual-gamepad","owner":"TwoSquirrels","description":"マイコンカー操作などのための、スマホ用バーチャルコントローラー (自分用)","archived":false,"fork":false,"pushed_at":"2024-07-22T16:05:38.000Z","size":47,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T03:25:14.298Z","etag":null,"topics":["arduino","esp32","gamepad","m5atom","m5stack","virtual-gamepad"],"latest_commit_sha":null,"homepage":"https://twosquirrels.github.io/virtual-gamepad/","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/TwoSquirrels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-07-09T02:46:00.000Z","updated_at":"2024-10-19T09:37:52.000Z","dependencies_parsed_at":"2024-07-22T19:14:20.128Z","dependency_job_id":null,"html_url":"https://github.com/TwoSquirrels/virtual-gamepad","commit_stats":null,"previous_names":["twosquirrels/virtual-gamepad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TwoSquirrels/virtual-gamepad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoSquirrels%2Fvirtual-gamepad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoSquirrels%2Fvirtual-gamepad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoSquirrels%2Fvirtual-gamepad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoSquirrels%2Fvirtual-gamepad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwoSquirrels","download_url":"https://codeload.github.com/TwoSquirrels/virtual-gamepad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoSquirrels%2Fvirtual-gamepad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274609465,"owners_count":25316621,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arduino","esp32","gamepad","m5atom","m5stack","virtual-gamepad"],"created_at":"2025-02-09T14:52:25.591Z","updated_at":"2026-05-07T13:06:51.351Z","avatar_url":"https://github.com/TwoSquirrels.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Gamepad\n\nマイコンカー操作などのための、スマホ用バーチャルコントローラーです。(もちろん PC も対応しています)\n\n\u003chttps://twosquirrels.github.io/virtual-gamepad/\u003e から HTML をダウンロードできますが、自分用に作ったので汎用性は低いかもしれません。気に入らない場合は Fork して改造してください。Pull Request 大歓迎です。\n\n\u003e [!TIP]  \n\u003e ジョイスティック部分は [nippleJS](https://github.com/yoannmoinet/nipplejs) を使っています。  \n\u003e シンプルな構成で作ったので、Web 初心者でも読みやすいかもしれません。コメントが少ないのはごめんなさい。\n\n## License\n\n\u0026copy; 2024 TwoSquirrels  \n[MIT License](LICENSE) に従ってください。\n\n## Usage\n\n### サーバー側 (マイコン等)\n\n1. [以下の規格](#Protocol) の形式の HTTP リクエストを処理できるプログラムを走らせます。([参考: M5Atom によるマイコンカーのサンプル](example/m5atom-car/))\n2. 対象のサーバーのアドレスを確認します。\n\n### コントローラー側\n\n3. 対象サーバー (マイコン等) のアドレスをブラウザで開きます。\n4. ジョイスティックの送信間隔 (デフォルト $100~\\mathrm{ms}$) を調整します。通信が詰まらない程度に小さくすることをおすすめします。\n5. A, B ボタンを使わない場合は隠します。\n6. 設定画面を閉じ、スワイプまたは WASD (+ Shift) で操作します。\n\n## Protocol\n\n\u003e [!WARNING]  \n\u003e github.io 上など HTTPS のページから HTTP のホストに対して通信をするとセキュリティエラーが出ます。これはブラウザの設定で対処することもできますが、API と同じホストで HTML を配信してそちらからページにアクセスすることを推奨します。\n\n### GET `/`\n\n#### Request\n\n基本的にブラウザからアクセスされます。\n\n#### Response\n\nゲームパッドの HTML を返してください。HTML は \u003chttps://twosquirrels.github.io/virtual-gamepad/\u003e から最新の物をダウンロードできるようにすることをおすすめします。\n\n### POST `/joystick?p=aaff`\n\n#### Request\n\nジョイスティックが操作されている時と WASD 操作している時に設定した間隔で、ジョイスティックの極座標が以下の形式で $4$ 桁の $16$ 進数に変換された文字列がクエリに載って送信されます。\n\n- `aa`: 右方向を $0$ として、そこから左回りで一周 $256$ の偏角 $0 \\leq \\theta \u003c 256$ の整数値を $16$ 進数 $2$ 桁で表した文字列\n- `ff`: 中心を $0$、スティックの限界を $255$ とした動径 $0 \\leq r \u003c 256$ の整数値を $16$ 進数 $2$ 桁で表した文字列 (WASD 操作の場合は Shift 押下時 `7F` となります)\n\nbody は常に空です。\n\n#### Response\n\nデバッグコンソールに表示されることを除けば、無視されます。\n\n### POST `/a`, `/b`\n\n#### Request\n\n画面右側のボタンを押した時に、ボタンの中身に対応したパスに送信されます。body は常に空です。\n\n#### Response\n\nデバッグコンソールに表示されることを除けば、無視されます。\n\n## Examples\n\n- [M5Atom によるマイコンカーのサンプル](example/m5atom-car/)\n- その他のサンプル募集中！\n\n## Tech Stack\n\n**Site Builder:** [Vite](https://ja.vitejs.dev/)  \n**Languages:** HTML, JavaScript, CSS  \n**Design:** [sanitize.css](https://csstools.github.io/sanitize.css/)  \n**Package Manager:** [pnpm](https://pnpm.io/ja/)  \n**Hosting:** [GitHub Pages](https://docs.github.com/ja/pages/getting-started-with-github-pages/about-github-pages)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwosquirrels%2Fvirtual-gamepad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwosquirrels%2Fvirtual-gamepad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwosquirrels%2Fvirtual-gamepad/lists"}