{ "info": { "author": "Linus Groh", "author_email": "mail@linusgroh.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System", "Topic :: System :: Hardware", "Topic :: System :: Hardware :: Hardware Drivers", "Topic :: Utilities" ], "description": "# xbox360controller\n> A pythonic Xbox360 controller API built on top of the `xpad` Linux kernel driver.\n\n[![PyPI Version][pypi-image]][pypi-url] [![Build Status][travis-image]][travis-url] [![Code Health][landscape-image]][landscape-url]\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 Rasperry 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\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/)) \u2013 mail@linusgroh.de\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[pypi-image]: https://img.shields.io/pypi/v/xbox360controller.svg?style=flat-square\n[pypi-url]: https://pypi.org/project/xbox360controller/\n[travis-image]: https://img.shields.io/travis/linusg/xbox360controller/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/linusg/xbox360controller\n[landscape-image]: https://landscape.io/github/linusg/xbox360controller/master/landscape.svg?style=flat-square\n[landscape-url]: https://landscape.io/github/linusg/xbox360controller", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://pypi.org/project/xbox360controller/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/linusg/xbox360controller", "keywords": "xbox,xbox360,controller,gamepad,game,raspberry pi,event,led,rumble", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "xbox360controller", "package_url": "https://pypi.org/project/xbox360controller/", "platform": "", "project_url": "https://pypi.org/project/xbox360controller/", "project_urls": { "Download": "https://pypi.org/project/xbox360controller/", "Homepage": "https://github.com/linusg/xbox360controller" }, "release_url": "https://pypi.org/project/xbox360controller/1.1.2/", "requires_dist": null, "requires_python": "", "summary": "A pythonic Xbox360 controller API built on top of the xpad Linux kernel driver.", "version": "1.1.2" }, "last_serial": 4086315, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7fe84aa1de6e05d06a1820bbe1bdf551", "sha256": "77fd7b452bd6405a0918a89585d3d38f2c5932e900fbf3bc3bba37db67618e4a" }, "downloads": -1, "filename": "xbox360controller-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7fe84aa1de6e05d06a1820bbe1bdf551", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10806, "upload_time": "2018-01-04T18:08:18", "url": "https://files.pythonhosted.org/packages/68/55/4979485b9cccc5f9b7533699ad0dd854dd50d5278a4666bfae9bc46a0e25/xbox360controller-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "251d6d41fa122183e74b49f63332e754", "sha256": "0a7b1d03a25c591e189f5186868aacf66338017451832fe8301d7ae05df752a9" }, "downloads": -1, "filename": "xbox360controller-1.0.1.tar.gz", "has_sig": false, "md5_digest": "251d6d41fa122183e74b49f63332e754", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10648, "upload_time": "2018-01-04T18:12:32", "url": "https://files.pythonhosted.org/packages/fb/83/5f115e7c100502ae788bf2e2ee7b628dacecd90b39a462c8359e6f7d0ab7/xbox360controller-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4180b7b1009fdac14f8dc16a9be37b80", "sha256": "f2168b619c41024649203782fb9a2988005d793528a8105e4f6615954d3d05b6" }, "downloads": -1, "filename": "xbox360controller-1.0.2.tar.gz", "has_sig": false, "md5_digest": "4180b7b1009fdac14f8dc16a9be37b80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10649, "upload_time": "2018-01-04T18:24:14", "url": "https://files.pythonhosted.org/packages/b4/5a/566957f163306f80ebde5526b11d1440f06cb69fd33f52f31450f002ce3c/xbox360controller-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "5a6a0024b5daec167658cfb406db3d45", "sha256": "4bd82bfd52e0a147f9f5a8b4dc65d3abf90fe63e62f74dad7daa1df2bd08a19d" }, "downloads": -1, "filename": "xbox360controller-1.0.3.tar.gz", "has_sig": false, "md5_digest": "5a6a0024b5daec167658cfb406db3d45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10859, "upload_time": "2018-01-04T20:09:34", "url": "https://files.pythonhosted.org/packages/e0/01/34cd6c4778d60fe85ec7d1fac68f02c84e40ffeb8a97df4a5a58800d6015/xbox360controller-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "c102b30da9dc23c1f4c079ac8869698f", "sha256": "a9f4c25bff820f6c7cfb9df54de5c3d67a91c3b6e6c7b35e3425f9fc18750825" }, "downloads": -1, "filename": "xbox360controller-1.0.4.tar.gz", "has_sig": false, "md5_digest": "c102b30da9dc23c1f4c079ac8869698f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9046, "upload_time": "2018-01-04T20:45:48", "url": "https://files.pythonhosted.org/packages/8c/bb/33b4e6e4aaaf656479de791a8d24bccc60ac62ac8cf36bd95398d3214d0a/xbox360controller-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "6c6ac87384b7642b3fed242a411ff18f", "sha256": "567fca6bacf888779b11b50b2f5a9b2426d321767f5a6f05991f88888d67bb38" }, "downloads": -1, "filename": "xbox360controller-1.0.5.tar.gz", "has_sig": false, "md5_digest": "6c6ac87384b7642b3fed242a411ff18f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11097, "upload_time": "2018-05-04T20:59:06", "url": "https://files.pythonhosted.org/packages/e5/ca/18574342697cbb2de5cfe2d881c48357adb56848d277ffb93045f634fadb/xbox360controller-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "4a70aa188750ccbcb59ea3d2a3b6dc65", "sha256": "37f72cb11c14e9e986a0e92a7616e70a599055335d320ac1c19ebc91e684b52c" }, "downloads": -1, "filename": "xbox360controller-1.0.6.tar.gz", "has_sig": false, "md5_digest": "4a70aa188750ccbcb59ea3d2a3b6dc65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10545, "upload_time": "2018-05-06T22:45:01", "url": "https://files.pythonhosted.org/packages/d2/45/1fdfb849333a9d82171b8c6254475478bdce63e01257a5784829da037f67/xbox360controller-1.0.6.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "7424854f1ae4bef536a21a8853858106", "sha256": "a0a10886a97061afb6f84bab783ea1dd0c3704c94bdbc5a5df4539e10e755c72" }, "downloads": -1, "filename": "xbox360controller-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7424854f1ae4bef536a21a8853858106", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10548, "upload_time": "2018-05-06T23:34:04", "url": "https://files.pythonhosted.org/packages/10/76/328c2d3c6fd07001352ba29fcc291e5df8ddcbc6150e5c5a61c14e3d26fd/xbox360controller-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "5ed644326a8b1d72dd209325fbdb75cd", "sha256": "cd037ba46c018de82e33e660c22f88f2472f7f06085e66640daac5d9a0faabf8" }, "downloads": -1, "filename": "xbox360controller-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5ed644326a8b1d72dd209325fbdb75cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10972, "upload_time": "2018-07-15T11:44:03", "url": "https://files.pythonhosted.org/packages/a8/e1/bdbc793a6157bdbebdd2418d0aaba6b65bae7f4f703ad32c518b3da257b5/xbox360controller-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "1b09616798eac054090bfc5fd3b0fce0", "sha256": "e555ae16f7528ee2ea7528a15178e5c7c71e8e060b88c749071e74b7f6a1c76b" }, "downloads": -1, "filename": "xbox360controller-1.1.2.tar.gz", "has_sig": false, "md5_digest": "1b09616798eac054090bfc5fd3b0fce0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10987, "upload_time": "2018-07-20T16:23:55", "url": "https://files.pythonhosted.org/packages/e2/d8/f9b31876187e27d821eefbe2030918db8a757e9aa859f7c45ef836bb9a5a/xbox360controller-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b09616798eac054090bfc5fd3b0fce0", "sha256": "e555ae16f7528ee2ea7528a15178e5c7c71e8e060b88c749071e74b7f6a1c76b" }, "downloads": -1, "filename": "xbox360controller-1.1.2.tar.gz", "has_sig": false, "md5_digest": "1b09616798eac054090bfc5fd3b0fce0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10987, "upload_time": "2018-07-20T16:23:55", "url": "https://files.pythonhosted.org/packages/e2/d8/f9b31876187e27d821eefbe2030918db8a757e9aa859f7c45ef836bb9a5a/xbox360controller-1.1.2.tar.gz" } ] }