{"id":13734305,"url":"https://github.com/fornwall/gamepads","last_synced_at":"2025-07-28T08:04:55.062Z","repository":{"id":195583251,"uuid":"691712956","full_name":"fornwall/gamepads","owner":"fornwall","description":"Rust gamepad input library with a focus on ease of use.","archived":false,"fork":false,"pushed_at":"2025-02-25T21:54:47.000Z","size":43,"stargazers_count":11,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-12T07:40:52.288Z","etag":null,"topics":["gamedev","gamepad","input","rust","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fornwall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null}},"created_at":"2023-09-14T18:20:52.000Z","updated_at":"2025-06-08T08:34:40.000Z","dependencies_parsed_at":"2025-04-11T10:52:23.730Z","dependency_job_id":"5bc8aeed-c90e-437d-9646-527ba0abbe36","html_url":"https://github.com/fornwall/gamepads","commit_stats":null,"previous_names":["fornwall/gamepads"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fornwall/gamepads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fornwall%2Fgamepads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fornwall%2Fgamepads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fornwall%2Fgamepads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fornwall%2Fgamepads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fornwall","download_url":"https://codeload.github.com/fornwall/gamepads/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fornwall%2Fgamepads/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267482004,"owners_count":24094508,"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-07-28T02:00:09.689Z","response_time":68,"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":["gamedev","gamepad","input","rust","webassembly"],"created_at":"2024-08-03T03:00:54.487Z","updated_at":"2025-07-28T08:04:55.003Z","avatar_url":"https://github.com/fornwall.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":["Libraries: Plugins"],"readme":"[![CI](https://github.com/fornwall/gamepads/actions/workflows/ci.yml/badge.svg)](https://github.com/fornwall/gamepads/actions/workflows/ci.yml)\n[![Docs](https://docs.rs/gamepads/badge.svg)](https://docs.rs/gamepads/)\n[![Crates.io version](https://img.shields.io/crates/v/gamepads.svg)](https://crates.io/crates/gamepads)\n\n# gamepads\nRust gamepad input library with a focus on ease of use. Supports haptic feedback (dual rumble / vibrations) on the web, and can be used as a [macroquad plugin](https://github.com/fornwall/gamepads#how-to-use-as-a-macroquad-plugin).\n\n```rust\nuse gamepads::Gamepads;\n\nfn main() {\n    let mut gamepads = Gamepads::new();\n\n    loop {\n        gamepads.poll();\n\n        for gamepad in gamepads.all() {\n            println!(\"Gamepad id: {:?}\", gamepad.id());\n            for button in gamepad.all_currently_pressed() {\n                println!(\"Pressed button: {:?}\", button);\n            }\n            println!(\"Left thumbstick: {:?}\", gamepad.left_stick());\n            println!(\"Right thumbstick: {:?}\", gamepad.right_stick());\n        }\n\n        std::thread::sleep(std::time::Duration::from_millis(500));\n   }\n}\n```\n\nSee the [crate documentation](https://docs.rs/gamepads/latest/gamepads/) and the [examples](https://github.com/fornwall/gamepads/tree/main/examples/) for documentation and sample code.\n\n## What it is\n\n- On desktop this library is implemented on top of [gilrs](https://crates.io/crates/gilrs).\n- On web this is implemented on top of the [Gamepad API](https://www.w3.org/TR/gamepad/) exposed by browsers, including support for haptic feedback (aka \"dual rumble\" or \"force feedback\").\n  - It can be used in a `wasm-bindgen`-using project without any setup necessary.\n  - It can be used without `wasm-bindgen` (by specifying `default-features = false`), allowing it to be used as a `macroquad` plugin (see more below) or in a direct wasm build ([example](https://github.com/fornwall/gamepads/tree/main/examples/gamepads-wasm-direct)).\n\n## How to use as a macroquad plugin\nFor non-web targets, nothing special needs to be done to use this library with [macroquad](https://github.com/not-fl3/macroquad). But for a web build to work properly, two things needs to be done.\n\nFirst, since `macroquad` does not use `wasm-bindgen`, that feature in `gamepads` needs to be turned off by setting `default-features = false`:\n\n```toml\ngamepads = { version = \"*\", default-features = false }\n```\n\nSecond, a javascript plug-in ([source](https://github.com/fornwall/gamepads/blob/main/js/gamepads-src-0.1.js)) needs to be registered in the page embedding the built wasm file:\n\n```html\n\u003cscript src=\"https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://fornwall.github.io/gamepads/js/macroquad-gamepads-0.1.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nload(\"your-wasm-file.wasm\");\n\u003c/script\u003e\n```\n\nSee the [gamepads-macroquad](https://github.com/fornwall/gamepads/tree/main/examples/gamepads-macroquad) example.\n\n# Feedback\nPlease [report any issues found](https://github.com/fornwall/gamepads/issues) or [discuss questions and ideas](https://github.com/fornwall/gamepads/discussions)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornwall%2Fgamepads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffornwall%2Fgamepads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornwall%2Fgamepads/lists"}