{"id":17129479,"url":"https://github.com/linusg/xbox360controller","last_synced_at":"2025-08-31T20:12:37.990Z","repository":{"id":28099346,"uuid":"116254337","full_name":"linusg/xbox360controller","owner":"linusg","description":"🎮 A pythonic Xbox360 controller API built on top of the xpad Linux kernel driver","archived":false,"fork":false,"pushed_at":"2023-05-08T12:23:51.000Z","size":53,"stargazers_count":102,"open_issues_count":6,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-20T14:55:55.872Z","etag":null,"topics":["linux","linux-kernel-driver","python","python3","xbox","xbox-controller","xbox360","xbox360-controller","xpad"],"latest_commit_sha":null,"homepage":"","language":"Python","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/linusg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"2018-01-04T11:52:17.000Z","updated_at":"2025-06-03T07:35:46.000Z","dependencies_parsed_at":"2024-06-21T02:14:39.713Z","dependency_job_id":"85b507e3-5f6f-46ad-bda0-c4aac42548c7","html_url":"https://github.com/linusg/xbox360controller","commit_stats":{"total_commits":58,"total_committers":6,"mean_commits":9.666666666666666,"dds":0.08620689655172409,"last_synced_commit":"435e28a715927fe6332a1695712a670d5d358f16"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/linusg/xbox360controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linusg%2Fxbox360controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linusg%2Fxbox360controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linusg%2Fxbox360controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linusg%2Fxbox360controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linusg","download_url":"https://codeload.github.com/linusg/xbox360controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linusg%2Fxbox360controller/sbom","scorecard":{"id":591439,"data":{"date":"2025-08-11","repo":{"name":"github.com/linusg/xbox360controller","commit":"3d60ba86e6b02c5b9864ff4646e428741dccbcbe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 6/29 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T22:00:19.062Z","repository_id":28099346,"created_at":"2025-08-20T22:00:19.062Z","updated_at":"2025-08-20T22:00:19.062Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273032934,"owners_count":25034067,"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-08-31T02:00:09.071Z","response_time":79,"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":["linux","linux-kernel-driver","python","python3","xbox","xbox-controller","xbox360","xbox360-controller","xpad"],"created_at":"2024-10-14T19:09:44.948Z","updated_at":"2025-08-31T20:12:37.970Z","avatar_url":"https://github.com/linusg.png","language":"Python","readme":"# xbox360controller\n\u003e A pythonic Xbox360 controller API built on top of the `xpad` Linux kernel driver.\n\n[![PyPI](https://img.shields.io/pypi/v/xbox360controller)](https://pypi.org/project/xbox360controller/)\n![Python Version](https://img.shields.io/pypi/pyversions/xbox360controller)\n[![Downloads](https://pepy.tech/badge/xbox360controller)](https://pepy.tech/project/xbox360controller)\n[![License](https://img.shields.io/github/license/linusg/xbox360controller?color=d63e97)](https://github.com/linusg/xbox360controller/blob/master/LICENSE)\n[![Black](https://img.shields.io/badge/code%20style-black-000000)](https://github.com/ambv/black)\n[![Travis CI](https://api.travis-ci.org/linusg/xbox360controller.svg?branch=master)](https://travis-ci.org/linusg/xbox360controller)\n[![Issues](https://img.shields.io/github/issues/linusg/xbox360controller)](https://github.com/linusg/xbox360controller/issues)\n\nThis Python Package aims to provide a pythonic and complete API for your Xbox360 and similar game controllers.\nCurrently it's built on top of the Linux kernel driver `xpad` so you can use it on almost any Linux distribution including your Raspberry Pi projects etc.\n\nThe following features are supported:\n\n- Registering callbacks for **all** Buttons, Axes, Triggers and Hat in a `gpiozero`-inspired way\n- Setting the LED circle; all `xpad` provided options are possible: blinking, rotating, setting individual LEDs on and off, ...\n- Rumbling, both the left and right side can be controlled from 0 to 100 percent\n\n## Installation\n\nYou will need Python 3.4 or above.\n\nAny Linux distribution:\n\n```\npip3 install -U xbox360controller\n```\n\nYou might also use a _virtual environment_ or do a per-user install by providing the `--user` flag to above command.\nGlobal installations might require the usage of `sudo` or working directly from a root shell but are **not recommended**.\n\nIf the `pip3` command cannot be found, try `pip` or make sure to have pip installed properly:\n\n```\nsudo apt install python3-pip\n```\n\nOf course you don't need `sudo` when working from a root shell.\n\n## Usage\n\n### Basics\n\n```python\nimport signal\nfrom xbox360controller import Xbox360Controller\n\n\ndef on_button_pressed(button):\n    print('Button {0} was pressed'.format(button.name))\n\n\ndef on_button_released(button):\n    print('Button {0} was released'.format(button.name))\n\n\ndef on_axis_moved(axis):\n    print('Axis {0} moved to {1} {2}'.format(axis.name, axis.x, axis.y))\n\ntry:\n    with Xbox360Controller(0, axis_threshold=0.2) as controller:\n        # Button A events\n        controller.button_a.when_pressed = on_button_pressed\n        controller.button_a.when_released = on_button_released\n\n        # Left and right axis move event\n        controller.axis_l.when_moved = on_axis_moved\n        controller.axis_r.when_moved = on_axis_moved\n\n        signal.pause()\nexcept KeyboardInterrupt:\n    pass\n```\n\nThe above code will run until `Ctrl+C` is pressed. Each time on of the left or right axis is moved, the event will be processed. Additionally, the events of the A button are being processed.\n\nSee the [API reference](https://github.com/linusg/xbox360controller/blob/master/docs/API.md#xbox360controller-parameters) for a more detailed explanation of the `Xbox360Controller` class and how to use all available buttons, axes and the hat.\n\n### Rumbling\n\n```python\nimport time\nfrom xbox360controller import Xbox360Controller\n\nwith Xbox360Controller() as controller:\n    controller.set_rumble(0.5, 0.5, 1000)\n    time.sleep(1)\n```\n\nThis will enable rumble on both sides of the controller with each 50% strength for one second (1000ms). Note that the method call is non-blocking, thus we need to manually wait one second for the rumble to finish. You won't need this in a regular use case with `signal.pause()`.\n\n### LED\n\n```python\nimport time\nfrom xbox360controller import Xbox360Controller\n\nwith Xbox360Controller() as controller:\n    controller.set_led(Xbox360Controller.LED_ROTATE)\n    time.sleep(1)\n    controller.set_led(Xbox360Controller.LED_OFF)\n```\n\nThis will let the LED circle rotate for one second and then turn it off.\n\nSee the [API reference](https://github.com/linusg/xbox360controller/blob/master/docs/API.md#led) for all available LED modes.\n\n### Debug information\n\n```python\nfrom xbox360controller import Xbox360Controller\n\nwith Xbox360Controller() as controller:\n    controller.info()\n```\n\nThe output may look like this:\n\n```\nMicrosoft X-Box 360 pad at index 0\nAxes: 5\n\taxis_l\n\taxis_r\n\that\n\ttrigger_l\n\ttrigger_r\nButtons: 11\n\tbutton_a\n\tbutton_b\n\tbutton_x\n\tbutton_y\n\tbutton_trigger_l\n\tbutton_trigger_r\n\tbutton_select\n\tbutton_start\n\tbutton_mode\n\tbutton_thumb_l\n\tbutton_thumb_r\nRumble: yes\nDriver version: 2.1.0 1.0.1\n```\n\n## Development/contributing\n\nThis project is now in a somewhat stable state, and I really appreciate all kinds of contributions - may it be new or improved code, documentation or just a simple typo fix.\nJust provide me a PR and I'll be happy to include your work!\n\nFor feature requests, general questions or problems you face regarding this package please [open an issue](https://github.com/linusg/xbox360controller/issues/new).\n\n## Release History\n\nPlease see [`CHANGES.md`](https://github.com/linusg/xbox360controller/blob/master/CHANGES.md) for a complete release history.\n\n## Authors\n\n- Linus Groh ([**@linusg**](https://github.com/linusg/)) – mail@linusgroh.de\n\nThanks to [**@VidyaPuri**](https://github.com/VidyaPuri/) and [**@jennib3**](https://github.com/jennib3/) for pointing out installation issues and providing a fix!\n\n## License\n\nAll the code and documentation are distributed under the MIT license. See [`LICENSE`](https://github.com/linusg/xbox360controller/blob/master/LICENSE) for more information.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusg%2Fxbox360controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusg%2Fxbox360controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusg%2Fxbox360controller/lists"}