{"id":29746414,"url":"https://github.com/arvamer/gilrs","last_synced_at":"2025-07-26T07:13:48.114Z","repository":{"id":42597111,"uuid":"66001657","full_name":"Arvamer/gilrs","owner":"Arvamer","description":"Game Input Library for Rust - Mirror of https://gitlab.com/gilrs-project/gilrs","archived":false,"fork":false,"pushed_at":"2025-07-20T19:10:16.000Z","size":981,"stargazers_count":167,"open_issues_count":1,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-20T21:10:04.880Z","etag":null,"topics":["force-feedback","gamepad","input","joystick","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"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/Arvamer.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":"2016-08-18T13:59:16.000Z","updated_at":"2025-07-20T19:10:20.000Z","dependencies_parsed_at":"2024-08-24T18:55:01.199Z","dependency_job_id":"892c30f7-2a2b-4a9b-adc2-a96870fa8577","html_url":"https://github.com/Arvamer/gilrs","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/Arvamer/gilrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvamer%2Fgilrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvamer%2Fgilrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvamer%2Fgilrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvamer%2Fgilrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arvamer","download_url":"https://codeload.github.com/Arvamer/gilrs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arvamer%2Fgilrs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267133958,"owners_count":24040789,"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-26T02:00:08.937Z","response_time":62,"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":["force-feedback","gamepad","input","joystick","rust"],"created_at":"2025-07-26T07:13:47.125Z","updated_at":"2025-07-26T07:13:48.091Z","avatar_url":"https://github.com/Arvamer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"GilRs - Game Input Library for Rust\n===================================\n\n[![pipeline status](https://gitlab.com/gilrs-project/gilrs/badges/master/pipeline.svg)](https://gitlab.com/gilrs-project/gilrs/commits/master)\n[![Crates.io](https://img.shields.io/crates/v/gilrs.svg)](https://crates.io/crates/gilrs)\n[![Documentation](https://docs.rs/gilrs/badge.svg)](https://docs.rs/gilrs/)\n[![Minimum rustc version](https://img.shields.io/badge/rustc-1.80.0+-yellow.svg)](https://gitlab.com/gilrs-project/gilrs)\n\nGilRs abstract platform specific APIs to provide unified interfaces for working with gamepads.\n\nMain features:\n\n- Unified gamepad layout—buttons and axes are represented by familiar names\n- Support for SDL2 mappings including `SDL_GAMECONTROLLERCONFIG` environment\n  variable which Steam uses\n- Hotplugging—GilRs will try to assign new IDs for new gamepads and reuse the same\n  ID for gamepads which reconnected\n- Force feedback (rumble)\n- Power information (is gamepad wired, current battery status)\n\nThe project's main repository [is on GitLab](https://gitlab.com/gilrs-project/gilrs)\nalthough there is also a [GitHub mirror](https://github.com/Arvamer/gilrs).\nPlease use GitLab's issue tracker and merge requests.\n\nThis repository contains submodule; after you clone it, don't forget to run\n`git submodule init; git submodule update` (or clone with `--recursive` flag)\nor you will get compile errors.\n\nExample\n-------\n\n```toml\n[dependencies]\ngilrs = \"0.11.0\"\n```\n\n```rust\nuse gilrs::{Gilrs, Button, Event};\n\nlet mut gilrs = Gilrs::new().unwrap();\n\n// Iterate over all connected gamepads\nfor (_id, gamepad) in gilrs.gamepads() {\n    println!(\"{} is {:?}\", gamepad.name(), gamepad.power_info());\n}\n\nlet mut active_gamepad = None;\n\nloop {\n    // Examine new events\n    while let Some(Event { id, event, time, .. }) = gilrs.next_event() {\n        println!(\"{:?} New event from {}: {:?}\", time, id, event);\n        active_gamepad = Some(id);\n    }\n\n    // You can also use cached gamepad state\n    if let Some(gamepad) = active_gamepad.map(|id| gilrs.gamepad(id)) {\n        if gamepad.is_pressed(Button::South) {\n            println!(\"Button South is pressed (XBox - A, PS - X)\");\n        }\n    }\n}\n```\n\nSupported features\n------------------\n\n|                  | Input | Hotplugging | Force feedback |\n|------------------|:-----:|:-----------:|:--------------:|\n| Linux/BSD (evdev)|   ✓   |      ✓      |        ✓       |\n| Windows          |   ✓   |      ✓      |        ✓       |\n| OS X             |   ✓   |      ✓      |        ✕       |\n| Wasm             |   ✓   |      ✓      |       n/a      |\n| Android          |   ✕   |      ✕      |        ✕       |\n\nPlatform specific notes\n======================\n\nLinux/BSD (evdev)\n-----\n\nWith evdev, GilRs read (and write, in case of force feedback) directly from appropriate\n`/dev/input/event*` file. This mean that user have to have read and write access to this file.\nOn most distros it shouldn't be a problem, but if it is, you will have to create udev rule.\nOn FreeBSD generic HID gamepads use hgame(4) and special use Linux driver via `webcamd`.\n\nTo build GilRs, you will need pkg-config and libudev .pc file. On some distributions this file\nis packaged in separate archive (e.g., `libudev-dev` in Debian, `libudev-devd` in FreeBSD).\n\nWindows\n-----\n\nWindows defaults to using Windows Gaming Input instead of XInput. If you need to use XInput you\ncan disable the `wgi` feature (it's enabled by default) and enable the `xinput` feature.\n\nWindows Gaming Input requires an in focus window to be associated with the process to receive\nevents. You can still switch back to using xInput by turning off default features and enabling\nthe xinput feature.\n\nNote: Some (Older?) devices may still report inputs without a window but this is not the case\nfor all devices so if you are writing a terminal based game, use the xinput feature instead.\n\nWasm\n-----\n\nWasm implementation uses stdweb, or wasm-bindgen with the wasm-bindgen feature.\nFor stdweb, you will need [cargo-web](https://github.com/koute/cargo-web) to build gilrs for\nwasm32-unknown-unknown. For wasm-bindgen, you will need the wasm-bindgen cli or a tool like\n[wasm-pack](https://rustwasm.github.io/wasm-pack/installer/).\nUnlike other platforms, events are only generated when you call `Gilrs::next_event()`.\n\nSee [`./gilrs/examples/wasm/README.md`](./gilrs/examples/wasm/README.md) for running the examples using Wasm.\n\nLicense\n=======\n\nThis project is licensed under the terms of both the Apache License (Version 2.0) and the MIT\nlicense. See LICENSE-APACHE and LICENSE-MIT for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvamer%2Fgilrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farvamer%2Fgilrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvamer%2Fgilrs/lists"}