{ "info": { "author": "Zuzu_Typ", "author_email": "zuzu.typ@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: zlib/libpng License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries" ], "description": "# XInput\\-Python \n## A simple to use interface to the XInput API for Python\\. \n**XInput\\-Python** provides a few simple methods that can be used to query controller information\\. \n\n## Tiny Documentation \n*XInput is Windows only* \n### Installation \nXInput\\-Python is available from the [PyPI](https://pypi.org) using \n\n pip install XInput-Python\n\nIt can be inmported like this: \n\n import XInput\n\n### Using XInput\\-Python \nXInput\\-Python provides a few functions: \n`get_connected() -> (bool, bool, bool, bool)` Query which controllers are connected \\(note: don't query each frame\\) \n\n`get_state(user_index) -> State` Gets the State of the controller `user_index` \n\n`get_button_values(state) -> dict` Returns a dictionary, showing which buttons are currently being pressed\\. \n\n`get_trigger_values(state) -> (LT, RT)` Returns a tuple with the values of the left and right triggers in range `0.0` to `1.0` \n\n`get_thumb_values(state) -> ((LX, LY), (RX, RY))` Returns the values of the thumb sticks, expressed in X and Y ranging from `0.0` to `1.0` \n\n`set_vibration(user_index, left_speed, right_speed) -> bool (Success)` Sets the vibration of the left and right motors of `user_index` to values between `0` and `65535` or in range `0.0` to `1.0` respectively\\. \n\n`get_battery_information(user_index) -> (, )` Returns the battery information for `user_index` \n\n`set_deadzone(deadzone, value) -> None` Sets the deadzone values for left/right thumb stick and triggers\\. \n\nThe following deadzones exist: \n`XInput.DEADZONE_LEFT_THUMB` \\- \\(range 0 to 32767\\) Left thumb stick deadzone \\(default is 7849\\) \n\n`XInput.DEADZONE_RIGHT_THUMB` \\- \\(range 0 to 32767\\) Right thumb stick deadzone \\(default is 8689\\) \n\n`XInput.DEADZONE_TRIGGER` \\- \\(range 0 to 255\\) Trigger deadzone \\(default is 30\\) \n\n#### Using Events \nYou can also use the Event\\-system: \n\n events = get_events()\n\n\n`get_events` will return a generator that yields instances of the `Event` class\\. \n\nThe `Event` class always has the following members: \n`Event.user_index` \\(range 0 to 3\\) \\- the id of the controller that issued this event \n`Event.type` \\- which type of event was issued \n\nThe following events exist: \n`XInput.EVENT_CONNECTED == 1` \\- a controller with this `user_index` was connected \\(this event will even occur if the controller was connected before the script was started\\) \n\n`XInput.EVENT_DISCONNECTED == 2` \\- a controller with this `user_index` was disconnected \n\n`XInput.EVENT_BUTTON_PRESSED == 3` \\- a button was pressed on the controller `user_index` \n\n`XInput.EVENT_BUTTON_RELEASED == 4` \\- a button was released on the controller `user_index` \n\n`XInput.EVENT_TRIGGER_MOVED == 5` \\- a trigger was moved on the controller `user_index` \n\n`XInput.EVENT_STICK_MOVED == 6` \\- a thumb stick was moved on the controller `user_index` \n\n**Button Events** \nAll button related Events have the following additional members: \n`Event.button_id` \\- the XInput numerical representation of the button \n`Event.button` \\- a literal representation of the button \n\nThe following buttons exist: \n\n \"DPAD_UP\" == 1\n \"DPAD_DOWN\" == 2\n \"DPAD_LEFT\" == 4\n \"DPAD_RIGHT\" == 8\n \"START\" == 16\n \"BACK\" == 32\n \"LEFT_THUMB\" == 64\n \"RIGHT_THUMB\" == 128\n \"LEFT_SHOULDER\" == 256\n \"RIGHT_SHOULDER\" == 512\n \"A\" == 4096\n \"B\" == 8192\n \"X\" == 16384\n \"Y\" == 32768\n\n\n\n**Trigger Events** \nAll trigger related Events have the following additional members: \n`Event.trigger` \\(either `XInput.LEFT == 0` or `XInput.RIGHT == 1`\\) \\- which trigger was moved \n`Event.value` \\(range 0\\.0 to 1\\.0\\) \\- by how much the trigger is currently pressed \n\n**Stick Events** \nAll thumb stick related Events have the following additional members: \n`Event.stick` \\(either `XInput.LEFT == 0` or `XInput.RIGHT == 1`\\) \\- which stick was moved \n`Event.x` \\(range \\-1\\.0 to 1\\.0\\) \\- the position of the stick on the X axis \n`Event.y` \\(range \\-1\\.0 to 1\\.0\\) \\- the position of the stick on the Y axis \n`Event.value` \\(range 0\\.0 to 1\\.0\\) \\- the distance of the stick from it's center position \n`Event.dir` \\(tuple of X and Y\\) \\- the direction the stick is currently pointing \n\n### Demo \nRun `XInput.py` as main \\(`python XInput.py`\\) to see a visual representation of the controller input\\.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Zuzu-Typ/XInput-Python", "keywords": "XInput xinput-controller xinput-wrapper directx controller controller-api wrapper windows", "license": "zlib/libpng license", "maintainer": "", "maintainer_email": "", "name": "XInput-Python", "package_url": "https://pypi.org/project/XInput-Python/", "platform": "", "project_url": "https://pypi.org/project/XInput-Python/", "project_urls": { "Homepage": "https://github.com/Zuzu-Typ/XInput-Python" }, "release_url": "https://pypi.org/project/XInput-Python/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "A simple to use interface to the XInput API for Python", "version": "0.3.0" }, "last_serial": 5475241, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f97052abe48ae9d46f89e21c79220157", "sha256": "2acc7fc4ac9e4a16986eb1e529532736846b2ed58607a9e0f5a74e0bad908fc6" }, "downloads": -1, "filename": "XInput_Python-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f97052abe48ae9d46f89e21c79220157", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4480, "upload_time": "2019-06-15T09:54:27", "url": "https://files.pythonhosted.org/packages/24/ec/8af9bc82efc475b913181d755a3413a09e9046de80caa59c144cad097e5b/XInput_Python-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16a26a03af646003bf9b9e7c118a5b0b", "sha256": "36e80e55ee5e824f34dbecbc31e395667ba301d8fc04b5eba9ef368cb6f12932" }, "downloads": -1, "filename": "XInput-Python-0.1.0.tar.gz", "has_sig": false, "md5_digest": "16a26a03af646003bf9b9e7c118a5b0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5540, "upload_time": "2019-06-15T09:54:30", "url": "https://files.pythonhosted.org/packages/0f/2a/1c74e8dba8d758890193e63f694e658a6b95897d075326f1f1b98628cd3b/XInput-Python-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "16cc123dc83e56258bfc4a4bcc47b8b5", "sha256": "2eebdedad65f9cc85d08e6a993100f6e081c6d1a565c8ae23143ec84fe06fe71" }, "downloads": -1, "filename": "XInput_Python-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "16cc123dc83e56258bfc4a4bcc47b8b5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7692, "upload_time": "2019-06-24T09:35:46", "url": "https://files.pythonhosted.org/packages/b6/d6/6fd6c8476c2c2b49b4e48929505f671cf4209d183b4fdae6f21ab1c14f97/XInput_Python-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b34facd8ebee7c048d31c2f444e4aaec", "sha256": "dbf46707759f9f91ea73d9f69e14fcb0a1cda12c1ce692635dc2b0c0bfddc915" }, "downloads": -1, "filename": "XInput-Python-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b34facd8ebee7c048d31c2f444e4aaec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9996, "upload_time": "2019-06-24T09:35:48", "url": "https://files.pythonhosted.org/packages/b8/ba/d85fdd710e3659f731d8b30740decbcd0e53a5d5752c019a94ca6a5766a6/XInput-Python-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "eff18747e57f7fc4b1f6f0109cba8390", "sha256": "6aabb06aef19ac7b5ca80a1de01f3960d50e82a5f143c2c9e94fc6c591470362" }, "downloads": -1, "filename": "XInput_Python-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eff18747e57f7fc4b1f6f0109cba8390", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8317, "upload_time": "2019-07-02T06:19:31", "url": "https://files.pythonhosted.org/packages/e0/78/4d0a04f1f598fba814f95972e2fc50e03474104e3a91b9688b1c9aab976f/XInput_Python-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c989fb84a5d855c577df3719b252eb2", "sha256": "eb61f0be8fdd75714d10a012ce291e7f471a1de142cbbcced7ffc4217e91584f" }, "downloads": -1, "filename": "XInput-Python-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5c989fb84a5d855c577df3719b252eb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11587, "upload_time": "2019-07-02T06:19:32", "url": "https://files.pythonhosted.org/packages/be/6f/ef66170fcde06268a0c45c4b60757a673c3bf93ac5128d82aaca5ed591bb/XInput-Python-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eff18747e57f7fc4b1f6f0109cba8390", "sha256": "6aabb06aef19ac7b5ca80a1de01f3960d50e82a5f143c2c9e94fc6c591470362" }, "downloads": -1, "filename": "XInput_Python-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eff18747e57f7fc4b1f6f0109cba8390", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8317, "upload_time": "2019-07-02T06:19:31", "url": "https://files.pythonhosted.org/packages/e0/78/4d0a04f1f598fba814f95972e2fc50e03474104e3a91b9688b1c9aab976f/XInput_Python-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c989fb84a5d855c577df3719b252eb2", "sha256": "eb61f0be8fdd75714d10a012ce291e7f471a1de142cbbcced7ffc4217e91584f" }, "downloads": -1, "filename": "XInput-Python-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5c989fb84a5d855c577df3719b252eb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11587, "upload_time": "2019-07-02T06:19:32", "url": "https://files.pythonhosted.org/packages/be/6f/ef66170fcde06268a0c45c4b60757a673c3bf93ac5128d82aaca5ed591bb/XInput-Python-0.3.0.tar.gz" } ] }